http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52401

             Bug #: 52401
           Summary: lto can't handle ld script
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: tian...@cernet.edu.cn


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

So far as I know, qt is using ld script for windows target if there are too
many object files to link.

Reply via email to