[AddressSanitizer] Don't use weak linkage for __{start,stop}_asan_globals
authorPetr Hosek <phosek@google.com>
Fri, 5 Jun 2020 03:18:35 +0000 (20:18 -0700)
committerPetr Hosek <phosek@google.com>
Fri, 5 Jun 2020 03:18:35 +0000 (20:18 -0700)
commitd76e62fdb7a93d9a33f642b6b528f2562cc3c3f4
treebaa6e108faaf722521001c9a0254c6b65c41f7a6
parente5158b52730d323bb8cd2cba6dc6c89b90cba452
[AddressSanitizer] Don't use weak linkage for __{start,stop}_asan_globals

It should not be necessary to use weak linkage for these. Doing so
implies interposablity and thus PIC generates indirections and
dynamic relocations, which are unnecessary and suboptimal. Aside
from this, ASan instrumentation never introduces GOT indirection
relocations where there were none before--only new absolute relocs
in RELRO sections for metadata, which are less problematic for
special linkage situations that take pains to avoid GOT generation.

Patch By: mcgrathr

Differential Revision: https://reviews.llvm.org/D80605
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll