https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67417
Bug ID: 67417 Summary: powerpc64 bootstrap with -mcmodel=small results in linker error Product: gcc Version: 5.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: amodra at gmail dot com Target Milestone: --- To test recent powerpc64 linker changes I attempted to bootstrap gcc-5 with -mcmodel=small, and ran into /home/amodra/gnu/powerpc64-linux/bin/ld: libbackend.a(sel-sched-ir.o): In function `loop_iterator::loop_iterator(loop**, unsigned int)': sel-sched-ir.c:(.text+0x116f0): call to `loop_iterator::loop_iterator(loop**, unsigned int)' lacks nop, can't restore toc; (-mcmodel=small toc adjust stub) On investigating, I see there really isn't a nop, and the call is to a group with a different toc pointer. This despite the destination being defined in the same file. However, it is weak and there's another definition. nm -o gcc/*.o | grep _ZN13loop_iteratorC1EPP4loopj gcc/ipa-inline-analysis.o:0000000000000420 W _ZN13loop_iteratorC1EPP4loopj gcc/sel-sched-ir.o:00000000000013e0 W _ZN13loop_iteratorC1EPP4loopj