[PATCH] D56089: [ELF] A shared object is needed if any of its occurrences is needed

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 26 16:15:11 PST 2018


MaskRay added a comment.

https://bugs.llvm.org/show_bug.cgi?id=15823#c0 (clang -fuse-ld=lld -fsanitize=address test.c -Wl,--as-needed -ldl -lrt) is one real world case.

That example does not work today because libclang_rt.asan-x86_64.a has other references (shm_open) to librt.so so librt.so is needed.

But the idea may apply on other interceptor libraries: they may have their own --no-as-needed dependencies (librt.so), if the user application specifies -Wl,--as-needed -lrt , it will break (dlsym(RTLD_NEXT, "clock_gettime")) at runtime.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56089/new/

https://reviews.llvm.org/D56089





More information about the llvm-commits mailing list