diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-10-24 08:57:13 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-10-26 06:21:43 +0200 |
commit | 2d68037eb90ad8dab6402da04c7fc66f798b159f (patch) | |
tree | 11cd9d85e5cde81266c21b0694427d3588a3cfbe /Makefile | |
parent | eee1b8846b0788c866dabf04e85742a48662455f (diff) | |
download | barebox-2d68037eb90ad8dab6402da04c7fc66f798b159f.tar.gz |
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 <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221024065716.1215046-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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) |