From 2d68037eb90ad8dab6402da04c7fc66f798b159f Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 24 Oct 2022 08:57:13 +0200 Subject: ARM64: asm: rewrite ENTRY_FUNCTION(_WITHSTACK) fully in assembly Recent episode with pointer authentication showed again that for platforms without __attribute__((naked)), we are better off writing the early header in assembly. We still want to keep the board specific entry points in C for ease of use, so we have ENTRY_FUNCTION_WITHSTACK generate two symbols: - A 32-bit stack top value that's placed in .rodata - An entry point with the normal C code, including stack-using prologues The new common assembly head code will access the stack pointer in a position-independent manner and set it up, before continuing with the C code. The barebox header is part of the common assembly head code ensuring it's not moved around due to compiler code generation. The common code will need access to board-specific entry point and stack top. The former is readily available as the alias __pbl_board_entry. The latter is a bit more complicated, as the symbol may not exist for boards not using the common header in a multi-image build. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20221024065716.1215046-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ddbdc5e1d4..e792082c9e 100644 --- a/Makefile +++ b/Makefile @@ -660,8 +660,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-check) KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) # We don't have the necessary infrastructure to benefit from ARMv8.3+ pointer -# authentication. On older CPUs, they are interpreted as NOPs and blot the -# code and break less portable code that expects a very specific code layout +# authentication. On older CPUs, they are interpreted as NOPs bloating the code KBUILD_CFLAGS += $(call cc-option,-mbranch-protection=none) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) -- cgit v1.2.1