[compiler-rt] [sanitizer] Allow *___lcxx_override symbolse in symbolizer (PR #79904)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 13:35:08 PST 2024
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/79904
We don't intercept them, and they are not called and used only as
markers anyway.
>From a3fa9e9299c2cbffd4f9c70d8722d094a325915a Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Mon, 29 Jan 2024 13:34:52 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
=?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
.../sanitizer_common/symbolizer/scripts/build_symbolizer.sh | 6 ++++--
.../sanitizer_common/symbolizer/scripts/global_symbols.txt | 5 +++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
index f24d42cc84e417..7f4082a6cd190e 100755
--- a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
@@ -191,8 +191,10 @@ $OPT -passes=internalize -internalize-public-api-list=${SYMBOLIZER_API_LIST} all
$CC $FLAGS -fno-lto -c opt.bc -o symbolizer.o
echo "Checking undefined symbols..."
-nm -f posix -g symbolizer.o | cut -f 1,2 -d \ | LC_COLLATE=C sort -u > undefined.new
-(diff -u $SCRIPT_DIR/global_symbols.txt undefined.new | grep -E "^\+[^+]") && \
+export LC_ALL=C
+nm -f posix -g symbolizer.o | cut -f 1,2 -d \ | sort -u > undefined.new
+grep -Ev "^#|^$" $SCRIPT_DIR/global_symbols.txt | sort -u > expected.new
+(diff -u expected.new undefined.new | grep -E "^\+[^+]") && \
(echo "Failed: unexpected symbols"; exit 1)
cp -f symbolizer.o $OUTPUT
diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
index 0a4bc6989a0d72..ef522976a2c2da 100644
--- a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
@@ -1,3 +1,6 @@
+# This file is used to control symbols used by internal symbolizer. We want to
+# avoid unexpected dependency on function intercepted by sanitizers.
+
_GLOBAL_OFFSET_TABLE_ U
_ZN11__sanitizer13internal_mmapEPvjiiiy U
_ZN11__sanitizer13internal_mmapEPvmiiiy U
@@ -62,6 +65,8 @@ __sanitizer_symbolize_flush T
__sanitizer_symbolize_frame T
__sanitizer_symbolize_set_demangle T
__sanitizer_symbolize_set_inline_frames T
+__start___lcxx_override U
+__stop___lcxx_override U
__strdup U
__udivdi3 U
__umoddi3 U
More information about the llvm-commits
mailing list