[PATCH 3/8] pbl: have linker define __pbl_board_entry alias

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Oct 23 23:57:11 PDT 2022


We want the board-specific entry points to have control over what code
comes first. So far, we solved this by setting the entry point on the
linker command line and doing the early setup in inline assembly.
As __attribute__((naked)) is not supported for arm64, we'll move there
to out-of-line assembly and thus we'll need a way to portably reference
the board-specific entry point. Define a new alias that points at it.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 images/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/images/Makefile b/images/Makefile
index 218a24ff1ddd..aa5814710f28 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -59,6 +59,7 @@ $(pbl-lds): $(obj)/../arch/$(SRCARCH)/lib/pbl.lds.S FORCE
 quiet_cmd_elf__ ?= LD      $@
       cmd_elf__ ?= $(LD) $(LDFLAGS_pbl) --gc-sections		\
 		-e $(2) -Map $@.map $(LDFLAGS_$(@F)) -o $@		\
+		--defsym=__pbl_board_entry=$(2)  			\
 		-T $(pbl-lds)						\
 		--whole-archive $(BAREBOX_PBL_OBJS) $(obj)/piggy.o	\
 		$(obj)/sha_sum.o
-- 
2.30.2




More information about the barebox mailing list