From b80123230cda30eacd465e945c065e1a7e068877 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Tue, 19 Sep 2017 15:01:23 +0200 Subject: arm: provide a PCS-compliant setjmp implementation The previous setjmp-implementation (as a static inline function that contained an 'asm volatile' sequence) was extremely fragile: (some versions of) GCC optimised the set of registers. One critical example was the removal of 'r9' from the clobber list, if -ffixed-reg9 was supplied. To increase robustness and ensure PCS-compliant behaviour, the setjmp and longjmp implementation are now in assembly and closely match what one would expect to find in a libc implementation. Signed-off-by: Philipp Tomsich Tested-by: Andy Yan Series-changes: 3 - converted setjmp/longjmp from inline-assembly to separate .S files to improve predicatability if emitted code --- arch/arm/lib/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/lib/Makefile') diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 6e1c436933..abffa10c85 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -17,6 +17,12 @@ else obj-y += vectors.o crt0.o endif +ifdef CONFIG_ARM64 +obj-y += setjmp_aarch64.o +else +obj-y += setjmp.o +endif + ifndef CONFIG_SPL_BUILD ifdef CONFIG_ARM64 obj-y += relocate_64.o -- cgit v1.2.3