[Bug ld/30004] New: LD --exclude-all-symbols generates export table

2023-01-15 Thread pali at kernel dot org
Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- LD --exclude-all-symbols has issues for Native PE executables. It causes generation of empty export table and puts name of the output executable/driver (-o) as name of

[Bug binutils/30005] New: __declspec(code_seg("segname")) does not work

2023-01-15 Thread pali at kernel dot org
iority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- GCC/LD does not support __declspec(code_seg("segname")) declarator for specifying name of PE/COFF segment name. Instead GCC/LD supports differe

[Bug ld/30004] LD --exclude-all-symbols generates export table

2023-02-19 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30004 --- Comment #2 from Pali Rohár --- Hello! Sorry for a longer delay. Now I did tests with your proposed patch and export table and .edata section is not generated anymore. But there is one thing which I do not understand: Why when bfd_link_pic

[Bug ld/30137] New: LD --dynamicbase does not generate relocation info

2023-02-19 Thread pali at kernel dot org
Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- LD --dynamicbase does not work correctly for PE executables. It does not generate relocation info. Without relocation info in PE binary, it is not possible to

[Bug binutils/30139] New: Incorrect ordinal numbers for aliased symbols in DEF file

2023-02-19 Thread pali at kernel dot org
Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- DEF file can contain alias for some symbol via == operator. But if such aliased symbol is used in the code then binutils generates

[Bug ld/30140] New: LD does not link PE executable with symbols from DEF file

2023-02-19 Thread pali at kernel dot org
Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Lets take simple test-library.dll with one exported function "func1". And try to use it in test-executable.c. $ cat test-l

[Bug ld/30141] New: LD does not mark INIT section as IMAGE_SCN_MEM_DISCARDABLE

2023-02-19 Thread pali at kernel dot org
Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- INIT code section is used in NT drivers (Native PE binaries) only during initilization and section should be marked as discardable to not

[Bug binutils/30142] New: PE .rsrc section is generated as writable

2023-02-19 Thread pali at kernel dot org
: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- PE resources in .rsrc section should be read-only but LD/windres generates them as read-write. Simple test case: $ cat empty.c void empty(void) {} $ cat test-rsrc.rc 1

[Bug binutils/30143] New: All PE sections are paged

2023-02-19 Thread pali at kernel dot org
Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- GCC/LD for NT kernel drivers marks all functions as paged, including those which should not be paged. Driver functions which could be paged are those which are in PE section PAGE

[Bug ld/30144] New: LD --entry does not accept function name

2023-02-19 Thread pali at kernel dot org
: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- NT kernel drivers have as entry point function DriverEntry with stdcall calling convension. Compiling NT kernel drivers via GCC/LD would be lot of easier if LD supports

[Bug ld/30145] New: No way to specify PE IMAGE_SCN_* characteristics

2023-02-19 Thread pali at kernel dot org
Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- In some cases, mostly for debugging purposes, it is needed to change or overwrite default PE section characteristics (IMAGE_SCN_* flags). But after reading gcc, ld and

[Bug ld/30137] LD --dynamicbase does not generate relocation info

2023-02-19 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30137 --- Comment #2 from Pali Rohár --- But it does not generate relocation information for the call example in the bug description. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30137] LD --dynamicbase does not generate relocation info

2023-02-19 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30137 --- Comment #3 from Pali Rohár --- Ou, my bad. I totally forgot that I wrote example for AMD64 and AMD64 does not use relocation for indirect calls. Only 32-bit x86 needs it. IX86 example is: $ cat test-dynamicbase.S .globl _main _main:

[Bug binutils/30005] __declspec(code_seg("segname")) does not work

2023-02-19 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30005 --- Comment #2 from Pali Rohár --- Reported to gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108849 -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30147] New: Allow to specify PE export name

2023-02-19 Thread pali at kernel dot org
Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- When generating ELF binary it is possible to specify its export name by -soname= option, and this option is working fine ELF. But seems there is no way to specify export name when

[Bug ld/30004] LD --exclude-all-symbols generates export table

2023-02-20 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30004 --- Comment #5 from Pali Rohár --- Thanks! Anyway, the whole issue is about executables, not libraries. So I still do not understand reasons. And I'm not quite sure what it is "position independent DLL". Every DLL library should contain relo

[Bug ld/30147] Allow to specify PE export name

2023-02-20 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30147 --- Comment #2 from Pali Rohár --- It is quite annoying if for different platforms it is needed to use different command line options or different config files to specify some option, like setting export name. It makes build systems, scripts,

[Bug ld/30004] LD --exclude-all-symbols generates export table

2023-02-20 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30004 --- Comment #6 from Pali Rohár --- Hm... When I'm thinking about it, DLL library without export table does not make sense (or yes?). So maybe condition for generating export table when there is no exported symbol should have been based on the

[Bug ld/30300] New: LTO drops entry point symbol

2023-04-01 Thread pali at kernel dot org
Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Originally reported on: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109368 LTO for PE executables drops entry point symbol when the default entry point is used. There is no warning and

[Bug binutils/30139] Incorrect ordinal numbers for aliased symbols in DEF file

2023-04-07 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30139 --- Comment #1 from Pali Rohár --- Also see that linker generates two entries for one exported function in import table. For exported function is one entry in import table enough. -- You are receiving this mail because: You are on the CC lis

[Bug ld/30144] LD --entry does not accept function name

2023-04-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30144 --- Comment #2 from Pali Rohár --- As a workaround I have already come up with this: __attribute__((stdcall)) long DriverEntry(void *DriverObject, void *RegistryPath) asm("DriverEntry"); __attribute__((stdcall)) long DriverEntry(void *DriverO

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-04-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #2 from Pali Rohár --- In past I have tried to use objcopy --set-section-flags but it did not work, I did not get expected result and I do not remember exact details. As you mentioned this option, I will try it again with new binut

[Bug binutils/30143] All PE sections are paged

2023-04-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30143 --- Comment #2 from Pali Rohár --- Hello! I'm replying below as inline comments. (In reply to Nick Clifton from comment #1) > Hi Pali, > > OK, so I am assuming that the desired behaviour is specific to the NT > kernel. > Ie, the default

[Bug ld/30140] LD does not link PE executable with symbols from DEF file

2023-04-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30140 --- Comment #3 from Pali Rohár --- Thank you for information. I see that it is quite misleading because DEF file in some case is used for "dllimport" functionality and in some other cases is used for "dllexport" functionality. And this can be

[Bug ld/30147] Allow to specify PE export name

2023-04-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30147 --- Comment #3 from Pali Rohár --- I have tested that it is really possible to set export name via DEF file when generating PE binary. Export name can be specified via LIBRARY or via NAME keyword. At least I would suggest to extend -soname= d

[Bug ld/30343] New: LTO drops explicitly referenced symbol _pei386_runtime_relocator

2023-04-13 Thread pali at kernel dot org
Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Originally reported on: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109369 Points from discussion: * OTOH if the linker

[Bug binutils/30142] PE .rsrc section is generated as writable

2023-04-15 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30142 --- Comment #2 from Pali Rohár --- Hello! Thanks, I have tested this change and it works perfectly: $ readpe test-rsrc.exe | grep -A 11 'Name:\s*\.rsrc' export directory not found Name:.rsrc Virtual

[Bug ld/30300] LTO drops entry point symbol

2023-04-15 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30300 --- Comment #2 from Pali Rohár --- Hello! Patch is working fine: $ x86_64-w64-mingw32-gcc -Wall -Wextra -nostartfiles -nodefaultlibs -nostdlib test-nostartfiles.c -o test-nostartfiles.exe -flto $ x86_64-w64-mingw32-objdump -p test-nostartfil

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-04-15 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #3 from Pali Rohár --- Ok, I have tested objcopy --set-section-flags on PE executable. Seems that it is doing something, but only for some of the flags and I really do not understand what it is doing. For me it looks like that objc

[Bug ld/30359] New: Create Resource-Only DLL

2023-04-15 Thread pali at kernel dot org
Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Resource-Only DLL is windows PE binary of DLL type which does not contain any code, just resources in .rsrc section. See MS documentation for more details: https://learn.microsoft.com/en-us

[Bug ld/30359] Create Resource-Only DLL

2023-04-18 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #2 from Pali Rohár --- If adding empty import table and something in code .text sections is feature of the linker, it is somewhere documented? What it is doing and what is putting there (as those sections are not in any user suppli

[Bug ld/30359] Create Resource-Only DLL

2023-04-21 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #4 from Pali Rohár --- (In reply to Nick Clifton from comment #3) > (In reply to Pali Rohár from comment #2) > > If adding empty import table and something in code .text sections is feature > > of the linker, it is somewhere docume

[Bug binutils/30376] New: windres cannot parse rc files which it itself generated

2023-04-21 Thread pali at kernel dot org
Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- I took shell32.dll library from Windows XP. I have passed it to windres to generate RC file from it and then I passed this RC file back

[Bug ld/30343] LTO ignores linker reference to _pei386_runtime_relocator

2023-04-21 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30343 --- Comment #3 from Pali Rohár --- I have looked at the LD source code but I'm really not sure if I understood it correclty. But for me it looks like that when LD generates runtime pseudo reloc then it tries to reference _pei386_runtime_reloca

[Bug ld/30381] New: Support for specifying new Windows PE option via manifests

2023-04-23 Thread pali at kernel dot org
Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Target: mingw New features of Windows PE EXE/DLL binaries are being specified in embedded manifest. GNU LD currently does not

[Bug ld/30382] New: Add LD option for using UTF-8 code page in generated Windows PE binaries

2023-04-23 Thread pali at kernel dot org
: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Windows PE binaries generated by LD use by default legacy code page (e.g. CP1252) when working with any char* WinAPI

[Bug ld/30359] Create Resource-Only DLL

2023-04-25 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #6 from Pali Rohár --- (In reply to Nick Clifton from comment #5) > (In reply to Pali Rohár from comment #4) > > > > These markers are used by the execution startup code to help find the two > > > tables. > > > > I see... But in

[Bug ld/30390] New: Allow to specify custom stub for PE binaries

2023-04-25 Thread pali at kernel dot org
Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- MS linker has option /STUB for specifying custom stub binary which is included into final PE binary. GNU LD has hardcoded stub binary and does not allow user to specify

[Bug ld/30359] Create Resource-Only DLL

2023-04-25 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #7 from Pali Rohár --- Or maybe instead of "if (scnhdr_int->s_vaddr != 0)" it should be "#ifdef COFF_IMAGE_WITH_PE"? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30359] Create Resource-Only DLL

2023-04-26 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #9 from Pali Rohár --- That check s_size != 0 does not really look good. I have quickly scanned wine and reactos source codes and seems that they require non-zero VMA addresses for resources. Maybe another check could be based on e

[Bug ld/30300] LTO drops entry point symbol

2023-05-03 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30300 --- Comment #3 from Pali Rohár --- Do you need some more testing? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30359] Create Resource-Only DLL

2023-05-03 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #10 from Pali Rohár --- Checking IMAGE_SCN_MEM_DISCARDABLE is not a good idea too as this section is still loaded from .sys drivers and discarded after driver is initialized. -- You are receiving this mail because: You are on the

[Bug ld/30343] LTO ignores linker reference to _pei386_runtime_relocator

2023-05-05 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30343 --- Comment #5 from Pali Rohár --- Hello! I have test proposed fix and it works fine. Both LTO and non-LTO versions are correctly generated. Also everything is working fine when there is no psuedo reloc and _pei386_runtime_relocator() is not d

[Bug ld/30359] Create Resource-Only DLL

2023-05-08 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #12 from Pali Rohár --- This new linker script works fine. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-05-08 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #4 from Pali Rohár --- So it looks like that IMAGE_SCN_MEM_READ characteristic is always added, IMAGE_SCN_MEM_WRITE characteristic is added only when readonly flag is not specified. And other flags add following characteristics: a

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-05-10 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #2 from Pali Rohár --- I'm not sure if I can upload that generated file here due to possible legal problems. But if you agree, you can download some other shell32.dll from the internet. For example I found different version on htt

[Bug ld/30390] Allow to specify custom stub for PE binaries

2023-05-10 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30390 --- Comment #2 from Pali Rohár --- Stub is executable code, I think it can be any valid binary in MZ format. Restrictions about alignement or size would come from the MZ format itself. About objcopy, I do not know about any way how to replace

[Bug ld/30359] Create Resource-Only DLL

2023-05-10 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #14 from Pali Rohár --- Well, if this is the way how it should be used then "fixed" linker script should be distributed with linker. Or at least described in the LD documentation. Because it is really hard to find some information

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-05-11 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #5 from Pali Rohár --- Finally I found documentation about named resources which caused this issue: https://learn.microsoft.com/en-us/windows/win32/menurc/user-defined-resource And here there is no information that name or type sh

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-05-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #6 from Pali Rohár --- Hello Nick! Now I tried your patch. Now it is better because windres can compile its own generated rc file. But there are still issues. I did more repeated conversions between binary and text file via these

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-05-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #7 from Pali Rohár --- I did also another test. I took very simple resource file: $ cat test-resource.rc resource_name1 resource_type1 { "resource_string_data1" } resource_name2 "resource_type2" { "resource_string_data2" } "resour

[Bug ld/30359] Create Resource-Only DLL

2023-05-16 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30359 --- Comment #17 from Pali Rohár --- Thanks! -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-05-17 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #6 from Pali Rohár --- IMAGE_SCN_LNK_REMOVE is valid only for object files, not for executables. But yes, from above description exclude flag should be mapped to IMAGE_SCN_LNK_REMOVE characteristics. Also it would be great to sync

[Bug ld/30390] Allow to specify custom stub for PE binaries

2023-05-17 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30390 --- Comment #4 from Pali Rohár --- Ok, I understand reasons. And I think that replacing 64-byte array by another with same size by some special linker flag has likely very small value, because this simple replacement can be done by e.g. dd too

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-05-27 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #8 from Pali Rohár --- Thank you. I have looked at the change and from documented IMAGE_SCN_* flags at https://learn.microsoft.com/en-us/windows/win32/debug/pe-format and for dumping in section_flag_xlat[] are missing: IMAGE_SCN_GP

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-05-27 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #9 from Pali Rohár --- Ou, now I see that IMAGE_SCN_GPREL is alias for IMAGE_SCN_MEM_FARDATA and IMAGE_SCN_MEM_16BIT alias for IMAGE_SCN_MEM_PURGEABLE. And these twos are already in section_flag_xlat[]. And IMAGE_SCN_TYPE_DSECT is

[Bug binutils/30496] New: Add support for PE IMAGE_SCN_MEM_16BIT section characteristic

2023-05-28 Thread pali at kernel dot org
Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- PE for machine type of IMAGE_FILE_MACHINE_I386 (0x014c) can contain IMAGE_SCN_MEM_16BIT (0x0002) in section characteristics

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-05-28 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #10 from Pali Rohár --- Ah, flag 0x0002 has not only two differet names IMAGE_SCN_MEM_16BIT and IMAGE_SCN_MEM_PURGEABLE, but also two different meanings. For IMAGE_FILE_MACHINE_I386 it is means that section is 16-bit, for IMAGE

[Bug binutils/30496] Add support for PE IMAGE_SCN_MEM_16BIT section characteristic

2023-06-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30496 --- Comment #1 from Pali Rohár --- I have tested that DUMPBIN.EXE recognize IMAGE_SCN_MEM_16BIT also for other non-x86 platforms: IMAGE_FILE_MACHINE_MIPS16 (0x266), IMAGE_FILE_MACHINE_MIPSFPU16 (0x466) (where section is 16-bit) and in IMAGE_FI

[Bug binutils/30496] Add support for PE IMAGE_SCN_MEM_16BIT section characteristic

2023-09-30 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30496 --- Comment #2 from Pali Rohár --- I have tested that MS LINK.EXE put IMAGE_SCN_MEM_16BIT also into the final EXE file for section which was marked with this flag in object file. And also DUMPBIN.EXE recognize IMAGE_SCN_MEM_16BIT in EXE execut

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-09-30 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #8 from Pali Rohár --- Hello Nick, have you looked at my above comments? Do you need more tests here? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30390] Allow to specify custom stub for PE binaries

2023-09-30 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30390 --- Comment #5 from Pali Rohár --- Anyway, I see that for GO32 MZ binaries is bfd using GO32STUB env variable to specify other custom stub (bfd/coff-stgo32.c). So maybe this can be unified? -- You are receiving this mail because: You are on

[Bug ld/30922] New: gcc -pie generates unwanted PE export table

2023-09-30 Thread pali at kernel dot org
Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Target: x86_64-w64-mingw32 Originally reported on: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108851 When gcc is invoked with -pie option then for PE

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2023-09-30 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #12 from Pali Rohár --- https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#special-sections Some section names are reserved and .text is really there with IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_REA

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-10-04 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #11 from Pali Rohár --- (In reply to Nick Clifton from comment #10) > I think the point that you are trying to make however is that the MS > resource compiler actually includes the double quote characters as part of > the resource

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2023-10-05 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #13 from Pali Rohár --- Ok, if it is not possible to fix this particular case then it would be useful to document this incompatibility with MS RC format. I can understand that rewriting the whole parser is not something which is go

[Bug binutils/30376] windres cannot parse rc files which it itself generated

2024-01-06 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30376 --- Comment #14 from Pali Rohár --- Hello, have you looked at the problem described in comment #6 that res --> rc --> res --> rc actions are changing attributes? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/30922] gcc -pie generates unwanted PE export table

2024-01-07 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30922 --- Comment #1 from Pali Rohár --- Just to note that Position Independet Executable and Export Table are two totally different things. You can have (and it is pretty standard) to have fixed-address executable without relocation table (so it al

[Bug ld/30144] LD --entry does not accept function name

2024-03-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30144 --- Comment #3 from Pali Rohár --- > Looking into this, it is actually quite hard to predict the mangling of the > entry symbol name. Nick, cannot be 32-bit x86 PE ld easily extended in this way? When --entry=XYZ is specified at command line

[Bug ld/30145] No way to specify PE IMAGE_SCN_* characteristics

2024-03-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30145 --- Comment #13 from Pali Rohár --- Nick, do you plan to update your change? I think it is a good starting point. I would propose to do not allow these options to be available on non-PE targets (e.g. ELF) as it can be confusing. Just to note

[Bug ld/30147] Allow to specify PE export name

2024-03-12 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30147 --- Comment #4 from Pali Rohár --- Also I must admit that it is annoying if some flags has to be passed to LD as command line arguments and some other flags via (new temporary) file which is specified as command line argument. It is highly une

[Bug binutils/31543] New: windres announces non-PE targets as supported

2024-03-24 Thread pali at kernel dot org
Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Windres in documentation has described that it supports only COFF and RES binary formats. Which is correct as the Windows resources are stored and used only in

[Bug ld/31544] New: Incorrect default subsystem version for POSIX PE binaries

2024-03-24 Thread pali at kernel dot org
Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- GNU LD currently by default for POSIX PE binaries generated by --subsystem=posix option sets subsystem version to 4.0. MS LINK.EXE (via

[Bug binutils/31659] New: Fix Windows DEF file documentation

2024-04-19 Thread pali at kernel dot org
: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- binutils documentation for Windows DEF file is currently at these locations: * https://sourceware.org/binutils/docs/binutils/def-file-format.html * https

[Bug binutils/31659] Fix Windows DEF file documentation

2024-04-19 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31659 --- Comment #1 from Pali Rohár --- Interesting... bugzilla added hyperlink to PR keyword, I thought it is reference to some pull request. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31728] New: dlltool generates incorrect hints in import libraries

2024-05-10 Thread pali at kernel dot org
Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- When dlltool is requested to generate import library from the def file, it generates incorrect hints of the symbols. I scanned the git repository I

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-05-13 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #2 from Pali Rohár --- Hello Nick, I'm going to look at bug #20814 and bug #20880. And let you know. Anyway, what do you mean by "resolve both this PR" abbreviation? Because PR are initials of my name. -- You are receiving this

[Bug binutils/31738] New: Improve objdump -p output of PE Import and Export Tables

2024-05-13 Thread pali at kernel dot org
Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org CC: nickc at redhat dot com Target Milestone: --- Created attachment 15520 --> https://sourceware.org/bugzilla/attachment.cgi

[Bug binutils/20814] DLLTool Put Wrong Hint Value In Lib Archieve (IDATA6 Section)

2024-05-13 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20814 Pali Rohár changed: What|Removed |Added CC||pali at kernel dot org --- Comment #8

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-05-13 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #3 from Pali Rohár --- Hello Nick, For debugging this issue I created an improvement for objdump -p, see bug #31738. I wrote a new comment into bug #20814 with explanation and I think that Hint value in lib archive (= import libr

[Bug binutils/31738] Improve objdump -p output of PE Import and Export Tables

2024-05-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31738 --- Comment #3 from Pali Rohár --- Ok, feel free to modify it. I used it for debugging bug #31728, bug #20814 and bug #20880. Anyway, how to run that one exclude-symbols-def-i386.d test case? I can try to improve it, to validate both hint num

[Bug binutils/30139] Incorrect ordinal numbers for aliased symbols in DEF file

2024-05-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=30139 Pali Rohár changed: What|Removed |Added CC||nickc at redhat dot com --- Comment #2 f

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-06-21 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #4 from Pali Rohár --- Hello Nick, I have check that reverting both 35fd2ddeb1d90f1750401cfb6d01fe055656b88d and 4ee1d7e401a8c1aedfdc86aac7faa8267eab1e5c commits on top of the master git branch fixes hints in import libraries gene

[Bug binutils/20880] [LD] [Bug] Wrong Hint Value For ImportLib IDATA6

2024-06-21 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20880 Pali Rohár changed: What|Removed |Added CC||pali at kernel dot org --- Comment #13

[Bug binutils/20814] DLLTool Put Wrong Hint Value In Lib Archieve (IDATA6 Section)

2024-06-25 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20814 --- Comment #9 from Pali Rohár --- Nick, the commit 35fd2ddeb1d90f1750401cfb6d01fe055656b88d should be reverted too. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-06-26 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #5 from Pali Rohár --- Created attachment 15598 --> https://sourceware.org/bugzilla/attachment.cgi?id=15598&action=edit Improve documentation about Import Directory Table I attached a patch which improves documentation about Imp

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-06-27 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #8 from Pali Rohár --- Yes, we are good now. I will try to prepare some automated test case which will cover both ordinal numbers and hint numbers. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31953] New: Show PE objdump -P versions in human readable form

2024-07-03 Thread pali at kernel dot org
: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: pali at kernel dot org Target Milestone: --- Attached changes improves PE objdump -P output of version fields. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31953] Show PE objdump -P versions in human readable form

2024-07-03 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31953 --- Comment #1 from Pali Rohár --- Created attachment 15599 --> https://sourceware.org/bugzilla/attachment.cgi?id=15599&action=edit Show PE objdump -P Linker version in human readable form -- You are receiving this mail because: You are on

[Bug binutils/31953] Show PE objdump -P versions in human readable form

2024-07-03 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31953 --- Comment #2 from Pali Rohár --- Created attachment 15600 --> https://sourceware.org/bugzilla/attachment.cgi?id=15600&action=edit Show PE objdump -P Win32 Version field -- You are receiving this mail because: You are on the CC list for t

[Bug binutils/31953] Show PE objdump -P versions in human readable form

2024-07-03 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31953 --- Comment #3 from Pali Rohár --- Created attachment 15601 --> https://sourceware.org/bugzilla/attachment.cgi?id=15601&action=edit Show PE objdump -P versions in more human readable form Show major and minor versions at one line. Parse Win

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #9 from Pali Rohár --- Created attachment 15620 --> https://sourceware.org/bugzilla/attachment.cgi?id=15620&action=edit ld/testsuite: Improve PE exclude-symbols-* tests -- You are receiving this mail because: You are on the CC

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #10 from Pali Rohár --- Created attachment 15621 --> https://sourceware.org/bugzilla/attachment.cgi?id=15621&action=edit ld/testsuite: Add PE tests for Ordinal and Hints in PE Export Table generated by ld -- You are receiving t

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #11 from Pali Rohár --- Created attachment 15622 --> https://sourceware.org/bugzilla/attachment.cgi?id=15622&action=edit ld/testsuite: Add PE tests for Ordinal and Hints in PE Export Table generated by dlltool -- You are receiv

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #12 from Pali Rohár --- Created attachment 15623 --> https://sourceware.org/bugzilla/attachment.cgi?id=15623&action=edit ld/testsuite: Add PE tests for Ordinal and Hints in PE Import Table generated by dlltool -- You are receiv

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #13 from Pali Rohár --- Created attachment 15624 --> https://sourceware.org/bugzilla/attachment.cgi?id=15624&action=edit ld/testsuite: Add PE tests for Ordinal and Hints in PE Import Table generated by ld -- You are receiving t

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-14 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #14 from Pali Rohár --- I attached 5 changes which add PE tests for ordinal and hints for both PE Export and PE Import tables. For both dlltool and ld. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31953] Show PE objdump -P versions in human readable form

2024-07-21 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31953 Pali Rohár changed: What|Removed |Added CC||nickc at redhat dot com --- Comment #4 f

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-23 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #15 from Pali Rohár --- Hello Nick, have you looked at those test cases? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-25 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728 --- Comment #18 from Pali Rohár --- What are steps needed to reproduce this problem? Because is working for me with ./configure --target=i686-w64-mingw32 -- You are receiving this mail because: You are on the CC list for the bug.

  1   2   >