Carlo Kok via llvm-dev
2017-Feb-21 13:10 UTC
[llvm-dev] [lld] elf linker creates undefined empty symbol
Hi, When running my own lld generated library/executable I'm getting: LD_LIBRARY_PATH=. ./ConsoleApplication347 ./ConsoleApplication347: symbol lookup error: ./ConsoleApplication347: undefined symbol: (theres nothing after undefined symbol) How can I figure out what's I'm doing wrong? Full log: https://gist.github.com/carlokok/1dd510a16e1922271b520f1c00b14656 readelf -s for ConsoleApplication347: https://gist.github.com/carlokok/0950e4b33e0bf421852b3ac58fc18aea readelf -s for ClassLibrary22.so: https://gist.github.com/carlokok/109a03620abb95bdad6479426e3dce11 lld command line used: lld -flavor gnu -O0 --lto-O0 --eh-frame-hdr --dynamic-linker "/lib64/ld-linux-x86-64.so.2" "-L." "-oConsoleApplication347" "RemObjects.Elements.Cirrus.ConsoleApplication347.o" "libgc.a" "Island.a" "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-libc.so" "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-ClassLibrary22" "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-libpthread.so" "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-librt.so" "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-libgcc_s.so" Input files: https://www.dropbox.com/s/8yn3dggx05atn47/binLinux.zip?dl=0 output files: https://www.dropbox.com/s/vxzl9jfkssmp3tk/testapp.zip?dl=0 -- Carlo Kok RemObjects Software
Rui Ueyama via llvm-dev
2017-Feb-21 18:07 UTC
[llvm-dev] [lld] elf linker creates undefined empty symbol
Did you try to make a smaller test case? I'd try to remove unrelated code from your project to minimize the code size so that it is easy to find a cause. On Tue, Feb 21, 2017 at 5:10 AM, Carlo Kok via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > When running my own lld generated library/executable I'm getting: > > LD_LIBRARY_PATH=. ./ConsoleApplication347 > ./ConsoleApplication347: symbol lookup error: ./ConsoleApplication347: > undefined symbol: > > (theres nothing after undefined symbol) > > How can I figure out what's I'm doing wrong? > > Full log: > https://gist.github.com/carlokok/1dd510a16e1922271b520f1c00b14656 > > readelf -s for ConsoleApplication347: > https://gist.github.com/carlokok/0950e4b33e0bf421852b3ac58fc18aea > > readelf -s for ClassLibrary22.so: > https://gist.github.com/carlokok/109a03620abb95bdad6479426e3dce11 > > > lld command line used: > lld -flavor gnu -O0 --lto-O0 > --eh-frame-hdr --dynamic-linker "/lib64/ld-linux-x86-64.so.2" > "-L." > "-oConsoleApplication347" > "RemObjects.Elements.Cirrus.ConsoleApplication347.o" > "libgc.a" "Island.a" "RemObjects.Elements.Cirrus.im > portlib-ConsoleApplication347-libc.so" "RemObjects.Elements.Cirrus.im > portlib-ConsoleApplication347-ClassLibrary22" " > RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-libpthread.so" > "RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-librt.so" " > RemObjects.Elements.Cirrus.importlib-ConsoleApplication347-libgcc_s.so" > > > Input files: > https://www.dropbox.com/s/8yn3dggx05atn47/binLinux.zip?dl=0 > > > output files: > https://www.dropbox.com/s/vxzl9jfkssmp3tk/testapp.zip?dl=0 > > -- > Carlo Kok > RemObjects Software > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170221/eab512c3/attachment.html>
Rafael Avila de Espindola via llvm-dev
2017-Feb-21 19:33 UTC
[llvm-dev] [lld] elf linker creates undefined empty symbol
> Input files: > https://www.dropbox.com/s/8yn3dggx05atn47/binLinux.zip?dl=0If you pass --reproduce foo.tar to lld it will create a foo.tar file with all that is needed to reproduce the link. Can you also share how you created the various .o files? If so I might be able to try reducing the issue. Cheers, Rafael
Carlo Kok via llvm-dev
2017-Feb-21 21:22 UTC
[llvm-dev] [lld] elf linker creates undefined empty symbol
On 2017-02-21 20:33, Rafael Avila de Espindola wrote:>> Input files: >> https://www.dropbox.com/s/8yn3dggx05atn47/binLinux.zip?dl=0 > > If you pass --reproduce foo.tar to lld it will create a foo.tar file > with all that is needed to reproduce the link. > > Can you also share how you created the various .o files? If so I might > be able to try reducing the issue.It's created by my own compiler. https://www.dropbox.com/s/rmkyqks4lnr85rz/foo.tar?dl=0 My biggest problem is that I have no idea where I can start trying to narrow it down, on the so side, or on the executable side, the error is rather strange to begin with. -- Carlo Kok RemObjects Software