https://llvm.org/bugs/show_bug.cgi?id=30330

            Bug ID: 30330
           Summary: -rpath-link stores absolute path in NEEDED when
                    library has RPATH of "."
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

When using -rpath-link to link to a shared library that has an RPATH of ".",
lld stores the absolute path in the executable's NEEDED entry.  By contrast,
ld.bfd stores just the file name, with no path.

Steps to reproduce:

touch foo.c
echo 'int main(){return 0;}' > bar.c
clang -shared -Wl,-rpath,. -o libfoo.so foo.c

clang -fuse-ld=bfd -Wl,-rpath-link,$PWD -L$PWD -lfoo -o bar bar.c
objdump -x bar | grep libfoo
  NEEDED      libfoo.so

clang -fuse-ld=lld -Wl,-rpath-link,$PWD -L$PWD -lfoo -o bar bar.c
objdump -x bar | grep libfoo
  NEEDED      /home/evangyzen/tmp/lld/libfoo.so

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to