summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/fsanitize.c
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-08-06 22:07:29 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-08-06 22:07:29 +0000
commit0930643ff6f1684bf234a97f6a3b76bf8e30b0a1 (patch)
treee3f16c6f74310e4b9d31df5b9d90ecc66f4ce394 /clang/test/Driver/fsanitize.c
parentb3292a8469c398214e88d2dd56be6f4edb1d1728 (diff)
downloadbcm5719-llvm-0930643ff6f1684bf234a97f6a3b76bf8e30b0a1.tar.gz
bcm5719-llvm-0930643ff6f1684bf234a97f6a3b76bf8e30b0a1.zip
hwasan: Instrument globals.
Globals are instrumented by adding a pointer tag to their symbol values and emitting metadata into a special section that allows the runtime to tag their memory when the library is loaded. Due to order of initialization issues explained in more detail in the comments, shadow initialization cannot happen during regular global initialization. Instead, the location of the global section is marked using an ELF note, and we require libc support for calling a function provided by the HWASAN runtime when libraries are loaded and unloaded. Based on ideas discussed with @evgeny777 in D56672. Differential Revision: https://reviews.llvm.org/D65770 llvm-svn: 368102
Diffstat (limited to 'clang/test/Driver/fsanitize.c')
-rw-r--r--clang/test/Driver/fsanitize.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index 9a2a3836d15..0caac04637d 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -843,7 +843,9 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=platform %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-PLATFORM-ABI
// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=foo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-FOO-ABI
// CHECK-HWASAN-INTERCEPTOR-ABI: "-default-function-attr" "hwasan-abi=interceptor"
+// CHECK-HWASAN-INTERCEPTOR-ABI: "-target-feature" "+tagged-globals"
// CHECK-HWASAN-PLATFORM-ABI: "-default-function-attr" "hwasan-abi=platform"
+// CHECK-HWASAN-PLATFORM-ABI: "-target-feature" "+tagged-globals"
// CHECK-HWASAN-FOO-ABI: error: invalid value 'foo' in '-fsanitize-hwaddress-abi=foo'
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,pointer-compare,pointer-subtract %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POINTER-ALL
OpenPOWER on IntegriCloud