diff options
author | Fangrui Song <maskray@google.com> | 2018-12-27 22:24:45 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-12-27 22:24:45 +0000 |
commit | 50394f6e018fd347ae1ccb86f0ec0180ec5f7e33 (patch) | |
tree | d1f51a20a9f76e6ffcfb74b40d7e9c29bc5a0c56 /clang/lib/Lex/ModuleMap.cpp | |
parent | 1ce7fccbc902779992f7d7b71944caeb4c16968d (diff) | |
download | llvm-50394f6e018fd347ae1ccb86f0ec0180ec5f7e33.zip llvm-50394f6e018fd347ae1ccb86f0ec0180ec5f7e33.tar.gz llvm-50394f6e018fd347ae1ccb86f0ec0180ec5f7e33.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions