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



             Bug #: 14698

           Summary: ar, nm and ranlib don't use gcc's liblto_plugin.so in

                    BINDIR/../lib/bfd-plugins automatically

           Product: binutils

           Version: 2.24 (HEAD)

            Status: NEW

          Severity: normal

          Priority: P2

         Component: binutils

        AssignedTo: unassig...@sourceware.org

        ReportedBy: mar...@trippelsdorf.de

    Classification: Unclassified





ar, nm and ranlib use the LLVMgold.so plugin automatically,

it it is found in BINDIR/../lib/bfd-plugins.

(/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins on my system)

Unfortunately gcc's liblto_plugin is loaded automatically.



markus@x4 test % cat a.c

#include <stdio.h>



extern void foo1(void);

extern void foo4(void);



void foo2(void) {

  printf("Foo2\n");

}



void foo3(void) {

  foo4();

}



int main(void) {

  foo1();

}



markus@x4 test % clang -flto -c a.c -o a.o



markus@x4 test % nm a.o

nm: a.o: File format not recognized



markus@x4 test % sudo cp /usr/local/lib64/LLVMgold.so

/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins



markus@x4 test % nm a.o

         U foo1

00000000 T foo2

00000000 T foo3

         U foo4

00000000 T main

         U printf



markus@x4 test % sudo rm

/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/LLVMgold.so



markus@x4 test % gcc -fno-fat-lto-objects -flto a.c -c -o a.o



markus@x4 test % nm a.o

0000000000000001 C __gnu_lto_slim

0000000000000001 C __gnu_lto_v1



markus@x4 test % sudo cp

/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0/liblto_plugin.so.0.0.0

/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins



markus@x4 test % nm a.o

0000000000000001 C __gnu_lto_slim

0000000000000001 C __gnu_lto_v1



It would output the following if the gcc lto-plugin would be loaded 

automatically:



markus@x4 test % nm a.o

         U foo1

00000000 T foo2

00000000 T foo3

         U foo4

00000000 T main



A fix was posted at:

http://sourceware.org/ml/binutils/2012-10/msg00080.html



-- 

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