From 1b1d495338a14f51b80d585fd21e39bb876db61d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Jun 2024 14:29:38 -0600 Subject: [PATCH] FIH: Disable FIH labels on Apple targets The symbols injected here cause some kind of poor interaction with the linker on MacOS, which results in most of the code becoming hopelessly corrupt. For now, just disable these symbols on this target. Signed-off-by: David Brown --- boot/bootutil/include/bootutil/fault_injection_hardening.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootutil/include/bootutil/fault_injection_hardening.h b/boot/bootutil/include/bootutil/fault_injection_hardening.h index 65a400ad..fdf01b53 100644 --- a/boot/bootutil/include/bootutil/fault_injection_hardening.h +++ b/boot/bootutil/include/bootutil/fault_injection_hardening.h @@ -278,6 +278,8 @@ void fih_cfi_decrement(void); */ #if defined(__ICCARM__) #define FIH_LABEL(str, lin, cnt) __asm volatile ("FIH_LABEL_" str "_" #lin "_" #cnt "::" ::); +#elif defined(__APPLE__) +#define FIH_LABEL(str) do {} while (0) #else #define FIH_LABEL(str) __asm volatile ("FIH_LABEL_" str "_%=:" ::); #endif