https://sourceware.org/bugzilla/show_bug.cgi?id=25029
Bug ID: 25029 Summary: Invalid PE file caused by discarded .rdata section Product: binutils Version: 2.32 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: florin.saft...@soft-to-you.com Target Milestone: --- Created attachment 12000 --> https://sourceware.org/bugzilla/attachment.cgi?id=12000&action=edit code to reproduce bug Hello, I have attached a very simple NASM file that calls the Windows API to display a message box. I assemble the file with nasm -f win64 test.asm -o test.o I then link it with ld -o test_64.exe -L/c/msys64/mingw64/x86_64-w64-mingw32/lib test_64.o -lkernel32 -luser32 This used to work like a charm with ld 2.30, but produces an invalid file with ld 2.32. Specifically, the entry point address seems wrong. I suspect this is because of this commit https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=73af69e74974eaa155eec89867e3ccc77ab39f6d Since the .rdata section defines output symbols, it is not discarded and the . = ALIGN(4); instruction causes it to fill with 512 bytes of 0x00. However, this is not reflected in the resulting PE header -- 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