summaryrefslogtreecommitdiff
path: root/compiler-rt/lib/memprof/memprof_linux.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-02-16 19:36:39 -0800
committerGitHub <noreply@github.com>2024-02-16 19:36:39 -0800
commit8443ce563bf3500b705ab3507ae586e2a72d31f4 (patch)
tree02048d9a17623eeff376906a3af92fe09cda3003 /compiler-rt/lib/memprof/memprof_linux.cpp
parentdb836f6094eafa5e60ca6395c8c195960108142a (diff)
[sanitizer] Lift AsanDoesNotSupportStaticLinkage to sanitizer_common.h. NFC (#80948)
The `_DYNAMIC` reference from `AsanDoesNotSupportStaticLinkage` ensures that `clang++ -fsanitize=address -static` gets a linker error. `MemprofDoesNotSupportStaticLinkage` is similar for `-fmemory-profile`. Move the functions to sanitizer_common.h to be used by more sanitizers on ELF platforms. Fuchsia does not use interposition and opts out the check (its `AsanDoesNotSupportStaticLinkage` is a no-op).
Diffstat (limited to 'compiler-rt/lib/memprof/memprof_linux.cpp')
-rw-r--r--compiler-rt/lib/memprof/memprof_linux.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/compiler-rt/lib/memprof/memprof_linux.cpp b/compiler-rt/lib/memprof/memprof_linux.cpp
index fcb6f662a82e..26a2b456b874 100644
--- a/compiler-rt/lib/memprof/memprof_linux.cpp
+++ b/compiler-rt/lib/memprof/memprof_linux.cpp
@@ -38,8 +38,6 @@
#include <unistd.h>
#include <unwind.h>
-extern ElfW(Dyn) _DYNAMIC[];
-
typedef enum {
MEMPROF_RT_VERSION_UNDEFINED = 0,
MEMPROF_RT_VERSION_DYNAMIC,
@@ -57,11 +55,6 @@ namespace __memprof {
void InitializePlatformInterceptors() {}
void InitializePlatformExceptionHandlers() {}
-void *MemprofDoesNotSupportStaticLinkage() {
- // This will fail to link with -static.
- return &_DYNAMIC;
-}
-
uptr FindDynamicShadowStart() {
uptr shadow_size_bytes = MemToShadowSize(kHighMemEnd);
return MapDynamicShadow(shadow_size_bytes, SHADOW_SCALE,