Created attachment 7814 [details] 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.