diff options
author | Jerome Forissier <jerome@forissier.org> | 2020-09-03 14:37:31 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2020-09-04 14:25:44 +0200 |
commit | 3513f961cda064f90d10f7de72af6330427a2013 (patch) | |
tree | d034d13b91a2e19cfe1954618e26629426f5721d /core/arch/arm/kernel/misc_a32.S | |
parent | 827be46c173f31c57006af70ca3a15a5b1a7fba3 (diff) |
arm32: fold UNWIND(.fnstart/.fnend) into the FUNC macros
This change applies to arm32 assembler sources.
Instead of using UNWIND(.fnstart) after FUNC or LOCAL_FUNC and
UNWIND(.fnend) before END_FUNC, let's fold these statements into the
FUNC macros.
The .fnstart/.fnend directives mark the start and end of a function
with an unwind table entry (.ARM.exidx) and therefore a function
without them has no entry and cannot be unwound. This means that a
stack dump (on abort or panic) would stop when reaching such a
function.
As a result of this patch, a small number of functions now have an
entry in the unwind table when they had none before (the functions
which were using FUNC or LOCAL_FUNC but had no .fnstart/.fnend). It was
almost always a bug and this pacth only increases the size of the
.ARM.exidx section by a few bytes (tested on QEMU).
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'core/arch/arm/kernel/misc_a32.S')
-rw-r--r-- | core/arch/arm/kernel/misc_a32.S | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/core/arch/arm/kernel/misc_a32.S b/core/arch/arm/kernel/misc_a32.S index 0f4fbcb3..3366ea2d 100644 --- a/core/arch/arm/kernel/misc_a32.S +++ b/core/arch/arm/kernel/misc_a32.S @@ -12,15 +12,12 @@ /* size_t __get_core_pos(void); */ FUNC __get_core_pos , : , .identity_map -UNWIND( .fnstart) read_mpidr r0 b get_core_pos_mpidr -UNWIND( .fnend) END_FUNC __get_core_pos /* size_t get_core_pos_mpidr(uint32_t mpidr); */ FUNC get_core_pos_mpidr , : -UNWIND( .fnstart) mov r3, r0 /* @@ -55,7 +52,6 @@ UNWIND( .fnstart) #endif bx lr -UNWIND( .fnend) END_FUNC get_core_pos_mpidr /* Let platforms override this if needed */ @@ -66,7 +62,6 @@ END_FUNC get_core_pos_mpidr * returns cpsr to be set */ LOCAL_FUNC temp_set_mode , : -UNWIND( .fnstart) mov r1, r0 cmp r1, #CPSR_MODE_USR /* update mode: usr -> sys */ moveq r1, #CPSR_MODE_SYS @@ -75,12 +70,10 @@ UNWIND( .fnstart) bic r0, #CPSR_MODE_MASK /* clear mode */ orr r0, r1 /* set expected mode */ bx lr -UNWIND( .fnend) END_FUNC temp_set_mode /* uint32_t read_mode_sp(int cpu_mode) */ FUNC read_mode_sp , : -UNWIND( .fnstart) push {r4, lr} UNWIND( .save {r4, lr}) mrs r4, cpsr /* save cpsr */ @@ -89,12 +82,10 @@ UNWIND( .save {r4, lr}) mov r0, sp /* get the function result */ msr cpsr, r4 /* back to the old mode */ pop {r4, pc} -UNWIND( .fnend) END_FUNC read_mode_sp /* uint32_t read_mode_lr(int cpu_mode) */ FUNC read_mode_lr , : -UNWIND( .fnstart) push {r4, lr} UNWIND( .save {r4, lr}) mrs r4, cpsr /* save cpsr */ @@ -103,5 +94,4 @@ UNWIND( .save {r4, lr}) mov r0, lr /* get the function result */ msr cpsr, r4 /* back to the old mode */ pop {r4, pc} -UNWIND( .fnend) END_FUNC read_mode_lr |