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

             Bug #: 13298
           Summary: ar --plugin doesn't work on mixed  IR/non-IR input
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassig...@sourceware.org
        ReportedBy: hjl.to...@gmail.com
    Classification: Unclassified


[hjl@gnu-6 slim-1]$ cat main.c
extern int bar ();

int
main ()
{
  return bar ();
}
[hjl@gnu-6 slim-1]$ cat xxx.c
int
xxx ()
{
  return 0;
}
[hjl@gnu-6 slim-1]$ cat bar.c
extern int xxx ();

int bar (void)
{
  return xxx ();
}
[hjl@gnu-6 slim-1]$ make
/usr/gcc-4.7.0-x32/bin/gcc    -c -o main.o main.c
/usr/gcc-4.7.0-x32/bin/gcc -flto -c -o xxx.o xxx.c
/usr/gcc-4.7.0-x32/bin/gcc    -c -o bar.o bar.c
ld -r -o rel.o xxx.o bar.o
ar --plugin
/usr/gcc-4.7.0-x32/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/liblto_plugin.so
-rcsD lib.a rel.o
/usr/gcc-4.7.0-x32/bin/gcc -flto -o x main.o lib.a
main.o: In function `main':
main.c:(.text+0xa): undefined reference to `bar'
collect2: error: ld returned 1 exit status
make: *** [x] Error 1
[hjl@gnu-6 slim-1]$ 
..

Without --plugin, it works fine:

[hjl@gnu-6 slim-1]$ rm lib.a
[hjl@gnu-6 slim-1]$ make
ar -rcsD lib.a rel.o
/usr/gcc-4.7.0-x32/bin/gcc -flto -o x main.o lib.a
[hjl@gnu-6 slim-1]$

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to