https://sourceware.org/bugzilla/show_bug.cgi?id=17458
Bug ID: 17458 Summary: Symbol that normally exported from a binary reported as PREVAILING_DEF_IRONLY to a plugin Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at google dot com Reporter: rafael.espindola at gmail dot com CC: ian at airs dot com Created attachment 7814 --> https://sourceware.org/bugzilla/attachment.cgi?id=7814&action=edit testcase The attached testcase has a run.sh script. Running it on my machine prints 9: 0000000000400508 0 FUNC GLOBAL DEFAULT 11 _init 11: 00000000004006d4 0 FUNC GLOBAL DEFAULT 14 _fini 6: 000000000040064d 6 FUNC GLOBAL DEFAULT 13 bar 9: 0000000000400508 0 FUNC GLOBAL DEFAULT 11 _init 11: 00000000004006d4 0 FUNC GLOBAL DEFAULT 14 _fini The first run is using lto and the symbol bar is reported as PREVAILING_DEF_IRONLY which causes the plugin to drop it. On the second run -flto is not used and the linker keeps it in the main binary. When the program is executed, that is the symbol the dynamic linker will use. The testcase is sensitive to the versions used. If the commented line in the script is removed, the main binary symbol will have the same version as the one in the shared library and it is kept. It looks like all symbols of a given name are kept in the symbol table even if one with a preferred version is found. It is not clear if this is a bug or if the bug is telling the plugin the symbol is IRONLY. This is a reduced testcase from trying to override operator delete in the main binary. The same issue is present with gnu ld. -- 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