If an object file compiled with -flto is loaded by using ld script, the final ld procedure will report multiple definition error. $ cat a.c int main (){return 0;} $ cat a.ld INPUT(a.o) $ gcc -flto -c a.c $ gcc -flto a.ld /tmp/ccPbuiPm.ltrans0.ltrans.o: In function `main': ccPbuiPm.ltrans0.o:(.text+0x0): multiple definition of `main' a.o:a.c:(.text+0x0): first defined here a.o: In function `main': a.c:(.text+0x0): multiple definition of `main' a.o:a.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status This bug is also subbmited to gcc, please go to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52401
I believe this bug was fixed in 2.23