llvm-project/lld/test
Fangrui Song 50394f6e01 [ELF] A shared object is needed if any of its occurrences is needed
Summary:
If a DSO appears more than once with and without --as-needed, ld.bfd and gold consider --no-as-needed to takes precedence over --as-needed. lld didn't and this patch makes it do so.

This makes it a bit away from the position-dependent behavior (how
different occurrences of the same DSO interact) and protects us from
some mysterious runtime errors: if some interceptor libraries add their
own --no-as-needed dependencies (e.g. librt.so), and the user
application specifies -Wl,--as-needed -lrt , the absence of the
DT_NEEDED entry would make dlsym(RTLD_NEXT, "clock_gettime") return NULL
and would break at runtime.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: emaste, arichardson, llvm-commits

Differential Revision: https://reviews.llvm.org/D56089

llvm-svn: 350105
2018-12-27 22:24:45 +00:00
..
COFF [COFF] Set the CPU string for LTO like ELF does 2018-12-18 01:59:33 +00:00
Driver/Inputs
ELF [ELF] A shared object is needed if any of its occurrences is needed 2018-12-27 22:24:45 +00:00
MinGW [MinGW] Pass libpath to the COFF linker 2018-10-10 09:00:03 +00:00
Unit
darwin [Darwin] Do not error on '-lto_library' option 2018-06-13 18:59:14 +00:00
mach-o Make YAML quote forward slashes. 2018-10-12 16:31:20 +00:00
wasm Update for an llvm-dwarfdump change in output 2018-12-12 18:46:43 +00:00
CMakeLists.txt [CMake] Add an lld-test-depends target 2018-08-29 17:30:45 +00:00
lit.cfg.py Tolerate flaky LLD tests on NetBSD 2018-12-23 21:20:09 +00:00
lit.site.cfg.py.in Import lit.llvm after rLLD341134 2018-08-31 00:23:09 +00:00