https://sourceware.org/bugzilla/show_bug.cgi?id=30300
Nick Clifton <nickc at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nickc at redhat dot com --- Comment #1 from Nick Clifton <nickc at redhat dot com> --- Created attachment 14816 --> https://sourceware.org/bugzilla/attachment.cgi?id=14816&action=edit Proposed patch Hi Pali, Please try out this patch and let me know if it works for you. I must admit that for the longest time I was blaming the lto plugin rather than the linker, but it turns out that I was wrong. The key fact is that if the user adds "-e <foo>" to the linker command line then code in ld/ldemul.c adds an unresolved reference to <foo> which in turn prevents the LTO compiler from optimizing away any definitions of <foo>. When -e is not used, this undefined reference (to the default startup symbol _mainCRTStartup) was not being created and so the LTO compiler was dropping the code... Cheers Nick -- You are receiving this mail because: You are on the CC list for the bug.