[PATCH][lld] Use search path to find dynamic libraries in a linker script

Rui Ueyama ruiu at google.com
Fri Apr 26 00:55:55 PDT 2013


Hi Michael,

This is a patch to fix an issue of linker script handler.

If a path in GROUP command is not absolute, the linker needs to search
through the library search path. Currently lld does nothing about
non-absolute paths, so it fails to find a dynamic library if it's not
written as an absolute path in a linker script.


 include/lld/Core/Error.h                      |  3 ++-
 include/lld/ReaderWriter/ELFTargetInfo.h      |  5 +++++
 include/lld/ReaderWriter/ReaderLinkerScript.h |  9 ++++++---
 lib/Driver/Driver.cpp                         | 14 ++++++++------
 lib/ReaderWriter/ELF/ELFTargetInfo.cpp        | 50
+++++++++++++++++++++++---------------------------
 lib/ReaderWriter/ReaderLinkerScript.cpp       | 18 +++++++++++++-----
 test/elf/X86_64/Inputs/libfn-script.so        |  1 +
 test/elf/X86_64/Inputs/libscript.so           |  1 +
 test/elf/X86_64/dynlib-search.test            |  8 ++++++--
 9 files changed, 65 insertions(+), 44 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130426/2e7ac850/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linker-script.patch
Type: application/octet-stream
Size: 9323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130426/2e7ac850/attachment.obj>


More information about the llvm-commits mailing list