[PATCH] D68754: [sanitizers] Update linker scripts to avoid emutls issues.
Mitch Phillips via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 18:13:51 PDT 2019
hctim created this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.
Looks like the linker script for ASan contains an entry for "__sancov_*". Android TLS symbols are emulated, and so we end up with "__sancov_lowest_stack" actually ending up with a symbol name of "__emutls_v.__sancov_lowest_stack". This symbol is then discarded, as the linker script doesn't consider prefixes.
This patch fixes the above issue, and adds explicit exports of __sancov for other sanitizer libraries.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68754
Files:
compiler-rt/lib/asan/asan.syms.extra
compiler-rt/lib/hwasan/hwasan.syms.extra
compiler-rt/lib/msan/msan.syms.extra
compiler-rt/lib/ubsan/ubsan.syms.extra
compiler-rt/lib/ubsan_minimal/ubsan.syms.extra
Index: compiler-rt/lib/ubsan_minimal/ubsan.syms.extra
===================================================================
--- compiler-rt/lib/ubsan_minimal/ubsan.syms.extra
+++ compiler-rt/lib/ubsan_minimal/ubsan.syms.extra
@@ -1 +1 @@
-__ubsan_*
+*__ubsan_*
Index: compiler-rt/lib/ubsan/ubsan.syms.extra
===================================================================
--- compiler-rt/lib/ubsan/ubsan.syms.extra
+++ compiler-rt/lib/ubsan/ubsan.syms.extra
@@ -1 +1 @@
-__ubsan_*
+*__ubsan_*
Index: compiler-rt/lib/msan/msan.syms.extra
===================================================================
--- compiler-rt/lib/msan/msan.syms.extra
+++ compiler-rt/lib/msan/msan.syms.extra
@@ -1,2 +1,3 @@
-__msan_*
-__ubsan_*
+*__msan_*
+*__ubsan_*
+*__sancov_*
Index: compiler-rt/lib/hwasan/hwasan.syms.extra
===================================================================
--- compiler-rt/lib/hwasan/hwasan.syms.extra
+++ compiler-rt/lib/hwasan/hwasan.syms.extra
@@ -1,2 +1,3 @@
-__hwasan_*
-__ubsan_*
+*__hwasan_*
+*__ubsan_*
+*__sancov_*
Index: compiler-rt/lib/asan/asan.syms.extra
===================================================================
--- compiler-rt/lib/asan/asan.syms.extra
+++ compiler-rt/lib/asan/asan.syms.extra
@@ -1,4 +1,4 @@
-__asan_*
-__lsan_*
-__ubsan_*
-__sancov_*
+*__asan_*
+*__lsan_*
+*__ubsan_*
+*__sancov_*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68754.224227.patch
Type: text/x-patch
Size: 1344 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/7ef940e2/attachment.bin>
More information about the llvm-commits
mailing list