public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/52401] New: lto can't handle ld script
@ 2012-02-27 14:51 tianbin at cernet dot edu.cn
  2012-02-27 14:56 ` [Bug lto/52401] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tianbin at cernet dot edu.cn @ 2012-02-27 14:51 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: tianbin@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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/52401] lto can't handle ld script
  2012-02-27 14:51 [Bug lto/52401] New: lto can't handle ld script tianbin at cernet dot edu.cn
@ 2012-02-27 14:56 ` rguenth at gcc dot gnu.org
  2012-02-27 17:14 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-27 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-27
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-27 14:55:07 UTC ---
Confirmed.  There are other cases with linker-scripts / linker options that
are not handled well.

This one is more a linker bug though.  The input a.o should be translated
to the new replacement input that went though LTO processing, instead it
seems to be appended.

Please file a binutils bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/52401] lto can't handle ld script
  2012-02-27 14:51 [Bug lto/52401] New: lto can't handle ld script tianbin at cernet dot edu.cn
  2012-02-27 14:56 ` [Bug lto/52401] " rguenth at gcc dot gnu.org
@ 2012-02-27 17:14 ` pinskia at gcc dot gnu.org
  2012-02-28  3:44 ` tianbin at cernet dot edu.cn
  2014-08-06 10:40 ` amodra at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-27 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-27 17:11:27 UTC ---
>So far as I know, qt is using ld script for windows target if there are too
many object files to link.

QT should also be changed to use response files which allows GCC to see the
object files also.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/52401] lto can't handle ld script
  2012-02-27 14:51 [Bug lto/52401] New: lto can't handle ld script tianbin at cernet dot edu.cn
  2012-02-27 14:56 ` [Bug lto/52401] " rguenth at gcc dot gnu.org
  2012-02-27 17:14 ` pinskia at gcc dot gnu.org
@ 2012-02-28  3:44 ` tianbin at cernet dot edu.cn
  2014-08-06 10:40 ` amodra at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tianbin at cernet dot edu.cn @ 2012-02-28  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Bin Tian <tianbin at cernet dot edu.cn> 2012-02-28 02:59:03 UTC ---
(In reply to comment #1)
> Confirmed.  There are other cases with linker-scripts / linker options that
> are not handled well.
> 
> This one is more a linker bug though.  The input a.o should be translated
> to the new replacement input that went though LTO processing, instead it
> seems to be appended.
> 
> Please file a binutils bug.

http://sourceware.org/bugzilla/show_bug.cgi?id=13779


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/52401] lto can't handle ld script
  2012-02-27 14:51 [Bug lto/52401] New: lto can't handle ld script tianbin at cernet dot edu.cn
                   ` (2 preceding siblings ...)
  2012-02-28  3:44 ` tianbin at cernet dot edu.cn
@ 2014-08-06 10:40 ` amodra at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: amodra at gmail dot com @ 2014-08-06 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |amodra at gmail dot com
         Resolution|---                         |WORKSFORME

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
Works with mainline ld.  Has been fixed for quite a while.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-06 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 14:51 [Bug lto/52401] New: lto can't handle ld script tianbin at cernet dot edu.cn
2012-02-27 14:56 ` [Bug lto/52401] " rguenth at gcc dot gnu.org
2012-02-27 17:14 ` pinskia at gcc dot gnu.org
2012-02-28  3:44 ` tianbin at cernet dot edu.cn
2014-08-06 10:40 ` amodra at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).