From a6ebe08333dcc6c263b6bb8936d4883663c63798 Mon Sep 17 00:00:00 2001 From: Harshit Sharma Date: Mon, 20 Jul 2020 00:21:05 -0700 Subject: lib: Add ASan support to romstage on x86 arch This patch adds ASan support to romstage on x86 architecture. A Kconfig option is added to enable ASan in romstage. Compiler flags are updated. A memory space representing the shadow region is reserved in linker section. And a function call to asan_init() is added to initialize shadow region when romstage loads. Change-Id: I67ebfb5e8d602e865b1f5c874860861ae4e54381 Signed-off-by: Harshit Sharma Reviewed-on: https://review.coreboot.org/c/coreboot/+/43604 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh --- src/include/symbols.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/symbols.h b/src/include/symbols.h index 2fbb449122..57c52eed53 100644 --- a/src/include/symbols.h +++ b/src/include/symbols.h @@ -24,7 +24,12 @@ DECLARE_REGION(cbfs_cache) DECLARE_REGION(fmap_cache) DECLARE_REGION(tpm_tcpa_log) -#if CONFIG(ASAN_IN_RAMSTAGE) +#if ENV_ROMSTAGE && CONFIG(ASAN_IN_ROMSTAGE) +DECLARE_REGION(bss) +DECLARE_REGION(asan_shadow) +#endif + +#if ENV_RAMSTAGE && CONFIG(ASAN_IN_RAMSTAGE) DECLARE_REGION(data) DECLARE_REGION(heap) DECLARE_REGION(asan_shadow) -- cgit v1.2.3