compiler.h: Add a new attribute nosanitize_undefined

This allow us to disable UBSan for particular function.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2022-08-30 08:15:58 +00:00
committed by Xiang Xiao
parent 1b04bfae20
commit 7e316d0ba9
+8
View File
@@ -195,6 +195,10 @@
# define nosanitize_address __attribute__ ((no_sanitize_address))
/* The nosanitize_undefined attribute informs GCC don't sanitize it */
# define nosanitize_undefined __attribute__((no_sanitize("undefined")))
/* The nostackprotect_function attribute disables stack protection in
* sensitive functions, e.g., stack coloration routines.
*/
@@ -465,6 +469,7 @@
# define noinline_function
# define noinstrument_function
# define nosanitize_address
# define nosanitize_undefined
# define nostackprotect_function
# define unused_code
@@ -597,6 +602,7 @@
# define noinline_function
# define noinstrument_function
# define nosanitize_address
# define nosanitize_undefined
# define nostackprotect_function
# define unused_code
# define unused_data
@@ -698,6 +704,7 @@
# define noinline_function
# define noinstrument_function
# define nosanitize_address
# define nosanitize_undefined
# define nostackprotect_function
# define unused_code
# define unused_data
@@ -765,6 +772,7 @@
# define noinline_function
# define noinstrument_function
# define nosanitize_address
# define nosanitize_undefined
# define nostackprotect_function
# define unused_code
# define unused_data