Hi,<div><br></div><div>I fixed error by using different version of ld with LLVM 2.7.</div><div>I used ld.gold that comes with Ubuntu 10.04.</div><div>Here is the version info:</div><div><br></div><div><div>sangmin@sangmin-desktop:/tmp$ ld -v</div>

<div>GNU gold (GNU Binutils for Ubuntu 2.20.1-system.20100303) 1.9</div><div><br></div><div>My experience of gold plugin is as follows:</div><div><br></div><div>LLVM 2.7 (with libLLVMgold.so) + ld 2.20.1 (from Ubuntu 10.04) : O</div>

<div><meta http-equiv="content-type" content="text/html; charset=utf-8">LLVM 2.7 (with libLLVMgold.so) + ld 2.21.51 (manually compiled) : X</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><meta http-equiv="content-type" content="text/html; charset=utf-8">LLVM 2.8 (with LLVMgold.so) + ld 2.20.1 (from Ubuntu 10.04): X</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><meta http-equiv="content-type" content="text/html; charset=utf-8">LLVM 2.8 (with LLVMgold.so) + ld 2.21.51 (manually compiled): X</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>When compiling (lib)LLVMgold.so file, I used the source file from ld 2.21.51. </div>

<div><br></div><div>I can work with LLVM 2.7 and ld 2.20.1 now, but am curious with the result.</div><div>Can you explain what part I did wrong?</div><div><br></div><div>Thanks,</div><div>Sangmin</div><div><br></div><div>

<br></div><br><div class="gmail_quote">On Mon, Mar 21, 2011 at 9:13 PM, Sangmin Park <span dir="ltr"><<a href="mailto:sangmin.park@gmail.com">sangmin.park@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi all,
<div><br></div><div>I got an error from the gold plugin example in the following link:</div><div><a href="http://llvm.org/docs/GoldPlugin.html#example1" target="_blank">http://llvm.org/docs/GoldPlugin.html#example1</a></div>

<div><br></div>
<div>Here is the error message:</div><div><br></div><div><div>sangmin@sangmin-desktop:/tmp$ llvm-gcc -use-gold-plugin a.a b.o -o main </div><div>/usr/bin/ld: error: a.a: no archive symbol table (run ranlib)</div><div>/usr/bin/ld: /usr/lib/crt1.o:(.text+0x18): error: undefined reference to 'main'</div>


<div>/usr/bin/ld: b.o: in function foo1:b.c(.text+0x4): error: undefined reference to 'foo2'</div><div>collect2: ld returned 1 exit status</div></div><div><br></div><div>I followed the instructions from the previous thread below, but I still have the problem.</div>


<div><a href="http://old.nabble.com/llvm-gold-plugin-example-td28140005.html" target="_blank">http://old.nabble.com/llvm-gold-plugin-example-td28140005.html</a></div><div><br></div><div>I got the error with both 2.7 and 2.8. </div>

<div>Here are my settings:</div>
<div><br></div><div>LLVMgold.so in  (with LLVM 2.8)</div><div>- $HOME/llvm-gcc-4.2-2.8-i686-linux/libexec/gcc/i686-pc-linux-gnu/4.2.1/LLVMgold.so</div><div>- $HOME/llvm-gcc-4.2-2.8-i686-linux/lib/bfd-plugins/LLVMgold.so</div>


<div>- /usr/lib/bfd-plugins/LLVMgold.so</div><div><br></div><div>libLLVMgold.so in (with LLVM 2.7)</div><div><div>
- $HOME/llvm-gcc-4.2-2.7-i686-linux/libexec/gcc/i686-pc-linux-gnu/4.2.1/libLLVMgold.so</div><div>- $HOME/llvm-gcc-4.2-2.7-i686-linux/lib/bfd-plugins/libLLVMgold.so</div><div>- /usr/lib/bfd-plugins/libLLVMgold.so</div></div>


<div><br></div><div>Compiled ld-new, ar, nm-new are linked to /usr/bin/ld, /usr/bin/ar, /uar/bin/nm, respectively.</div><div><br></div><div><div>sangmin@sangmin-desktop:/tmp$ ld -v</div><div>GNU gold (GNU Binutils 2.21.51.20110316) 1.11</div>


</div><div><br></div><div><br></div><div>Thanks in advance for your help.</div><div><br></div><font color="#888888"><div>Sangmin</div>
</font></blockquote></div><br><br clear="all"><br>-- <br>Sangmin Park / Ph.D. student<div>College of Computing</div><div>Georgia Institute of Technology</div><br>
</div>