http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59842
Bug ID: 59842 Summary: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tg at mirbsd dot org Created attachment 31855 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31855&action=edit test runner Hi *, I originally filed this as Debian #735564 but a user informed me they are also seeing this on other GNU/Linux distributions, and with GCC 4.7.1 on Slackware. Since a while, I’m getting errors like these: `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o I used to be able to avoid them (although, back then, the symbol was named “__i686.get_pc_thunk.bx”) by adding -march=i486, but this no longer helps. Screen log (the files x.sh, x.i and x.sym are attached): tglase@tglase:~ $ mksh x.sh `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o `__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o collect2: error: ld returned 1 exit status IMHO, GCC may not mark symbols as discardable that it uses by itself. Adding this to the symbol file is no solution either, as this becomes highly platform- and compiler-dependent.