aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/include
diff options
context:
space:
mode:
authordab <dab@FreeBSD.org>2019-11-19 14:46:28 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-26 14:18:46 +0100
commitb9967c3f9040c25efe0a67b59dbd05ee79d0a97d (patch)
tree2bffbde99f7208489ef21a9cb6d722e7047d97af /newlib/libc/include
parentc25de3a3c51e3d27133947a3d943c2a2127445d5 (diff)
downloadnewlib-b9967c3f9040c25efe0a67b59dbd05ee79d0a97d.zip
newlib-b9967c3f9040c25efe0a67b59dbd05ee79d0a97d.tar.gz
newlib-b9967c3f9040c25efe0a67b59dbd05ee79d0a97d.tar.bz2
Don't sanitize linker_set
The assumptions of linker_set don't play nicely with AddressSanitizer. AddressSanitizer adds a 'redzone' of zeros around globals (including those in named sections), whereas linker_set assumes they are all packed consecutively like a pointer array. So: let's annotate linker_set so that AddressSanitizer ignores it. Submitted by: Matthew Bryan <matthew.bryan@isilon.com> Reviewed by: kib, rang_acm.org Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22239
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/sys/cdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h
index 9a0466f..1f2ce06 100644
--- a/newlib/libc/include/sys/cdefs.h
+++ b/newlib/libc/include/sys/cdefs.h
@@ -709,6 +709,13 @@
/* Function should not be analyzed. */
#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis)
+/* Function or variable should not be sanitized, ie. by AddressSanitizer */
+#if __has_attribute(no_sanitize)
+#define __nosanitizeaddress __attribute__((no_sanitize("address")))
+#else
+#define __nosanitizeaddress
+#endif
+
/* Guard variables and structure members by lock. */
#define __guarded_by(x) __lock_annotate(guarded_by(x))
#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))