[Bug ld/17196] New: .rsrc section from archive members are ignored (all Windows targets)
https://sourceware.org/bugzilla/show_bug.cgi?id=17196 Bug ID: 17196 Summary: .rsrc section from archive members are ignored (all Windows targets) Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: sashipa.ben at gmail dot com Created attachment 7723 --> https://sourceware.org/bugzilla/attachment.cgi?id=7723&action=edit simple example project The .rsrc section is discarded by ld when it comes from an archive (.a) member for all tested Windows targets (cygwin and mingw). Included an example project: $ make CC=i686-pc-mingw32 info > i686-pc-mingw32-gcc -m32 -mwin32 -mwindows -c -o rsrcbug.o rsrcbug.c > i686-pc-mingw32-windres -o resource.o resource.rc > i686-pc-mingw32-gcc -m32 -mwin32 -mwindows -o rsrcbug-ok.exe rsrcbug.o > resource.o > i686-pc-mingw32-ar rc resource.a resource.o > i686-pc-mingw32-ranlib resource.a > i686-pc-mingw32-gcc -m32 -mwin32 -mwindows -o rsrcbug-failed.exe rsrcbug.o > resource.a > > * rsrcbug-ok.exe > Entry 2 b000 010c Resource Directory [.rsrc] > 8 .rsrc 010c 0040b000 0040b000 4800 2**2 > [ 50](sec -2)(fl 0x00)(ty 0)(scl 103) (nx 1) 0x003f rsrcbug.c > [945](sec 9)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x .rsrc > > * rsrcbug-failed.exe > Entry 2 Resource Directory [.rsrc] > [ 50](sec -2)(fl 0x00)(ty 0)(scl 103) (nx 1) 0x003f rsrcbug.c > > * resource.o > Entry 2 Resource Directory [.rsrc] > 0 .rsrc 010c 003c 2**2 > [ 0](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x .rsrc > RELOCATION RECORDS FOR [.rsrc]: > 0048 rva32 .rsrc > > * rsrcbug.o > Entry 2 Resource Directory [.rsrc] > [ 0](sec -2)(fl 0x00)(ty 0)(scl 103) (nx 1) 0x rsrcbug.c > > * resource.a > Entry 2 Resource Directory [.rsrc] > 0 .rsrc 010c 003c 2**2 > [ 0](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x .rsrc > RELOCATION RECORDS FOR [.rsrc]: > 0048 rva32 .rsrc -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/17196] .rsrc section from archive members are ignored (all Windows targets)
https://sourceware.org/bugzilla/show_bug.cgi?id=17196 Benjamin Gerard changed: What|Removed |Added Target||*-*-mingw32 *-pc-cygwin CC||sashipa.ben at gmail dot com -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/17196] .rsrc section from archive members are ignored (all Windows targets)
https://sourceware.org/bugzilla/show_bug.cgi?id=17196 --- Comment #3 from Benjamin Gerard --- It makes perfect sense. I'll see which workaround suit my case better. Thank you for your time and sorry for the false alert. Cheers, Ben -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/18573] New: windres: resources alignment does not work.
https://sourceware.org/bugzilla/show_bug.cgi?id=18573 Bug ID: 18573 Summary: windres: resources alignment does not work. Product: binutils Version: 2.25 Status: NEW Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: sashipa.ben at gmail dot com Target Milestone: --- Created attachment 8382 --> https://sourceware.org/bugzilla/attachment.cgi?id=8382&action=edit Sample code to illustrate windres resource alignment problem Hello, I've just noticed this problem with windres (gave me a bit of a hardtime to understand the problem). The resource compiled with windres are not aligned. Despite this https://sourceware.org/bugzilla/show_bug.cgi?id=16065 I'm not sure what this code does. But it does not seem to align the resources. This would not be a big problem if it did not break some resources. For instance dialogs with combo box control that are not 32-bit aligned won't open properly (possibly some other controls). It's tricky enough as it does not generate any kind of error. Windows will just send a premature WM_DESTROY before the WM_INITDIALOG. I had a quick look at the source code. The easiest way to fix the problem seems to force the alignment in the binutils/resbin.c:res_to_bin() function. I've tried that and it worked but I did not watch the whole code in depth so I'm not sure it has any unexpected side effect. I've attached a little program to demonstrate the problem. Best regards, G.B -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/18573] windres: resources alignment does not work.
https://sourceware.org/bugzilla/show_bug.cgi?id=18573 Benjamin Gerard changed: What|Removed |Added CC||sashipa.ben at gmail dot com -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/18573] windres: resources alignment does not work.
https://sourceware.org/bugzilla/show_bug.cgi?id=18573 --- Comment #1 from Benjamin Gerard --- Created attachment 8383 --> https://sourceware.org/bugzilla/attachment.cgi?id=8383&action=edit Fix windres resource alignment issue. Patch to force a resource length to a multiple of 4 when it's converted to binary thus aligning subsequent resources to 32 bit. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/18573] windres: resources alignment does not work.
https://sourceware.org/bugzilla/show_bug.cgi?id=18573 Benjamin Gerard changed: What|Removed |Added Attachment #8383|0 |1 is obsolete|| --- Comment #2 from Benjamin Gerard --- Created attachment 8392 --> https://sourceware.org/bugzilla/attachment.cgi?id=8392&action=edit Fix windres resource alignment issue Replace gziped patch with plain/text -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils