Patrick Oppenlander <pattyo.lists@xxxxxxxxx> writes: > $ powerpc-eabispe-gcc -nostdlib -flto -fuse-linker-plugin -Os -o prog > main.o foo.o crt0.o `powerpc-eabispe-gcc -print-libgcc-file-name` > /tmp/ccJRW7xo.ltrans0.ltrans.o: In function `_Z3fooi.constprop.0.1466': > ccJRW7xo.ltrans0.o:(.text+0x74): undefined reference to `_rest32gpr_30_x' > collect2: ld returned 1 exit status > > This problem does not occur if -nostdlib isn't specified. This > suggests to me that gcc is somehow handling libgcc differently if it > is specified on the command line?? > > Is this my (stupid?) error or have I stumbled across a gcc bug? What version of the GNU binutils are you using? There have been several bugs in this area, and the fix is in the GNU linker and how it interacts with plugins. Try using the latest development version of the GNU binutils. If that doesn't help, file a bug report at http://sourceware.org/bugzilla with a complete self-contained test case. Ian