[Bug gold/16781] New: gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 Bug ID: 16781 Summary: gold breaks alignment of global variable Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ian at airs dot com Reporter: daniel.oertwig+sourcewarebug at gmail dot com CC: ccoutant at google dot com Created attachment 7506 --> https://sourceware.org/bugzilla/attachment.cgi?id=7506&action=edit Map produced when linking with gold, broken variable alignment Linking with gold breaks the alignment requirement I set on a global variable, using the C++11 alignas specifier. Linking the same with the default ld works. I suspect this only happens in combination with memory regions in the linker script, but I could not verify this. I am using clang++ to compile, and clang++ (which defaults to gold on my system) to link. I attached the map file produced as bug.map, where you can see that the variable bug does not start at a correctly aligned address. Using g++ (which I guess is using the "old" linker) to link and still clang++ to compile works fine, as seen in the attached good.map. Using g++ both to link and compile fails, too. But this is not linker related, as the alignemnt requirement is already broken in the *.o file. I tried to strip down a minimal example, seen in goldbug.cpp. The linker script used is in the attached goldbug.ld. Let me know if I can help any further! -- 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 gold/16781] gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 --- Comment #1 from Daniel Jour --- Created attachment 7507 --> https://sourceware.org/bugzilla/attachment.cgi?id=7507&action=edit good.map -- 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 gold/16781] gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 --- Comment #2 from Daniel Jour --- Created attachment 7508 --> https://sourceware.org/bugzilla/attachment.cgi?id=7508&action=edit goldbug.cpp -- 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 gold/16781] gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 --- Comment #3 from Daniel Jour --- Created attachment 7509 --> https://sourceware.org/bugzilla/attachment.cgi?id=7509&action=edit goldbug.ld Used linker script -- 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 gold/16781] gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 --- Comment #4 from Daniel Jour --- Created attachment 7510 --> https://sourceware.org/bugzilla/attachment.cgi?id=7510&action=edit commands used to build and link -- 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 gold/16781] gold breaks alignment of global variable
https://sourceware.org/bugzilla/show_bug.cgi?id=16781 Daniel Jour changed: What|Removed |Added Version|unspecified |2.24 -- 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