aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2022-04-07 22:35:24 -0700
committerFangrui Song <i@maskray.me>2022-04-07 22:35:24 -0700
commit795b07f5498c7e5783237418f34d7ea69e801f87 (patch)
treec0b87d7a5079b086a4deae366bb548b336e66610 /clang/lib/Frontend/TestModuleFileExtension.cpp
parent8a0406dcc8ec601e5612638a9d5ca049637c9366 (diff)
downloadllvm-795b07f5498c7e5783237418f34d7ea69e801f87.zip
llvm-795b07f5498c7e5783237418f34d7ea69e801f87.tar.gz
llvm-795b07f5498c7e5783237418f34d7ea69e801f87.tar.bz2
[asan] Always skip first object from dl_iterate_phdr
All platforms return the main executable as the first dl_phdr_info. FreeBSD, NetBSD, Solaris, and Linux-musl place the executable name in the dlpi_name field of this entry. It appears that only Linux-glibc uses the empty string. To make this work generically on all platforms, unconditionally skip the first object (like is currently done for FreeBSD and NetBSD). This fixes first DSO detection on Linux-musl. It also would likely fix detection on Solaris/Illumos if it were to gain PIE support (since dlpi_addr would not be NULL). Additionally, only skip the Linux VDSO on linux. Finally, use the empty string as the "seen first dl_phdr_info" marker rather than (char *)-1. If there was no other object, we would try to dereference it for a string comparison. Reviewed By: MaskRay, vitalybuka Differential Revision: https://reviews.llvm.org/D119515
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions