[LLVMdev] llvm gold plugin example

Rafael Espindola espindola at google.com
Thu Apr 22 18:40:52 PDT 2010

On 5 April 2010 10:24, Victor Zverovich <victor.zverovich at googlemail.com> wrote:
> Hi all,
> Following the example
> from http://llvm.org/docs/GoldPlugin.html#example1 gives the following error
> on Ubuntu Karmic:
> /usr/bin/ld: error: a.a: no archive symbol table (run ranlib)
> /usr/bin/ld: /usr/lib/crt1.o:../sysdeps/i386/elf/start.S:115: error:
> undefined reference to 'main'
> /usr/bin/ld: b.o: in function foo1:b.c(.text+0x4): error: undefined
> reference to 'foo2'
> collect2: ld returned 1 exit status
> I suppose this is due to missing "--plugin libLLVMgold.so" option.

bfd (the library used by nm and ar) should try to search for the
plugin in the bfd-plugins. Can you check that there is a link for the
plugin in that directory?

> Attached is a documentation patch that corrects this (also for nm).
> Best regards,
> Victor
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Rafael Ávila de Espíndola

More information about the llvm-dev mailing list