public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/43355]  New: Undefined references with -flto -fuse-linker-plugin, dependent on object file ordering
@ 2010-03-13 12:48 amonakov at gcc dot gnu dot org
  2010-03-13 13:00 ` [Bug lto/43355] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: amonakov at gcc dot gnu dot org @ 2010-03-13 12:48 UTC (permalink / raw)
  To: gcc-bugs

cat <<EOF >a.c 
extern int puts(const char*);
char *program;
void fail() {puts(program);}
EOF
cat <<EOF >b.c 
extern int puts(const char*);
extern char *program;
extern void fail();
void usage() {puts(program);}
int main(int argc, char *argv[])
{
  program = argv[0];
  if (argc)
    usage();
  else
    fail();
  return 0;
}
EOF

gcc -flto -fuse-linker-plugin -O2 b.c a.c 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/ccvkxseZ.lto.o: in function usage:ccHTGBCK.o(.text+0x3): error: undefined
reference to 'program'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/ccvkxseZ.lto.o: in function fail:ccHTGBCK.o(.text+0x13): error: undefined
reference to 'program'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/ccvkxseZ.lto.o: in function main:ccHTGBCK.o(.text+0x2c): error: undefined
reference to 'program'
collect2: ld returned 1 exit status

Works with reversed ordering or without -fuse-linker-plugin


-- 
           Summary: Undefined references with -flto -fuse-linker-plugin,
                    dependent on object file ordering
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amonakov at gcc dot gnu dot org


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


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

* [Bug lto/43355] Undefined references with -flto -fuse-linker-plugin, dependent on object file ordering
  2010-03-13 12:48 [Bug lto/43355] New: Undefined references with -flto -fuse-linker-plugin, dependent on object file ordering amonakov at gcc dot gnu dot org
@ 2010-03-13 13:00 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-13 13:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-03-13 13:00 -------
I think this is a known issue, either gold or the linker-plugin issues wrong
linker resolutions with commons.

*** This bug has been marked as a duplicate of 42757 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2010-03-13 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-13 12:48 [Bug lto/43355] New: Undefined references with -flto -fuse-linker-plugin, dependent on object file ordering amonakov at gcc dot gnu dot org
2010-03-13 13:00 ` [Bug lto/43355] " rguenth at gcc dot gnu dot org

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).