summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-07-04 10:38:04 +0000
committerFangrui Song <maskray@google.com>2019-07-04 10:38:04 +0000
commitf347541fbcfcdeeeed185c1d0437e5533df381c9 (patch)
treee389777d2531ae0a5ee9b58f44535d614bb93d15 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parent555d743fcfe2ecb91fe237439389a08ef6af6348 (diff)
downloadbcm5719-llvm-f347541fbcfcdeeeed185c1d0437e5533df381c9.tar.gz
bcm5719-llvm-f347541fbcfcdeeeed185c1d0437e5533df381c9.zip
[ELF] resolveUndefined: ignore undefined symbols in SharedFile for Undefined and SharedSymbol
If %t1.o has a weak reference on foo, and %t2.so has a non-weak reference on foo: `ld.lld %t1.o %t2.so -o %t` We incorrectly set the binding of the undefined foo to STB_GLOBAL. Fix this by ignoring undefined symbols in a SharedFile for Undefined and SharedSymbol. This fixes the binding of pthread_once when the program links against both librt.so and libpthread.so ``` a.o: STB_WEAK reference to pthread_once librt.so: STB_GLOBAL reference to pthread_once # should be ignored libstdc++.so: STB_WEAK reference to pthread_once # should be ignored libgcc_s.so.1: STB_WEAK reference to pthread_once # should be ignored ``` The STB_GLOBAL pthread_once issue (not fixed by D63974) can cause a link error when the result DSO is used to link another DSO with -z defs if -lpthread is not specified. (libstdc++.so.6 not having a dependency on libpthread.so is a really nasty hack...) We happened to create a weak undef before D63974 because libgcc_s.so.1 was linked the last and it changed the binding again to weak. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D64136 llvm-svn: 365129
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud