From 4188734ee4bc9e1f2ef6acaff738cb6336247960 Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Thu, 8 Oct 2020 18:02:36 +0800 Subject: [PATCH] Allow to disable stack protector feature Currently disabling stack protector will cause build to fail. This commit will fix that problem and allow to toggle feature when needed. Signed-off-by: Zbigniew Bodek Change-Id: Iee8ccfdb9fce4ba69aa557e2ac915ddc45b2f21e --- arch/arm/arm/src/los_hw_exc.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/arm/src/los_hw_exc.S b/arch/arm/arm/src/los_hw_exc.S index 25d8639c..9a51b2a5 100644 --- a/arch/arm/arm/src/los_hw_exc.S +++ b/arch/arm/arm/src/los_hw_exc.S @@ -57,7 +57,11 @@ .global _osExceptPrefetchAbortHdl .global _osExceptSwiHdl .global _osExceptUndefInstrHdl +#if defined(LOSCFG_CC_STACKPROTECTOR_ALL) || \ + defined(LOSCFG_CC_STACKPROTECTOR_STRONG) || \ + defined(LOSCFG_CC_STACKPROTECTOR) .global __stack_chk_guard_setup +#endif .fpu vfpv4 @@ -147,6 +151,9 @@ .endm #endif +#if defined(LOSCFG_CC_STACKPROTECTOR_ALL) || \ + defined(LOSCFG_CC_STACKPROTECTOR_STRONG) || \ + defined(LOSCFG_CC_STACKPROTECTOR) @ Description: Stack-Protector Init __stack_chk_guard_setup: PUSH {FP, LR} @@ -156,6 +163,7 @@ __stack_chk_guard_setup: ORR R2, R3, #0X80000000 STR R2, [R1] POP {FP, PC} +#endif @ Description: Undefined instruction exception handler _osExceptUndefInstrHdl: