As barebox proper is now an ELF file we no longer need to map the entry function to the start of the image. Just link it to wherever the linker wants it and drop the text_entry section. Also, remove the start() function and set the ELF entry to barebox_non_pbl_start() directly.
While at it also remove the bare_init stuff from the barebox proper linker script as it's only relevant to the PBL linker script which is a separate script. Signed-off-by: Sascha Hauer <[email protected]> --- arch/riscv/boot/start.c | 13 +------------ arch/riscv/boot/uncompress.c | 2 +- arch/riscv/lib/barebox.lds.S | 7 +------ 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/arch/riscv/boot/start.c b/arch/riscv/boot/start.c index 002ab3eccb4292d8d88a95f8b93163c970cb1d64..15bb91ac1b49ada66375507120256daff6b563f4 100644 --- a/arch/riscv/boot/start.c +++ b/arch/riscv/boot/start.c @@ -114,7 +114,7 @@ device_initcall(barebox_memory_areas_init); * First function in the uncompressed image. We get here from * the pbl. The stack already has been set up by the pbl. */ -__noreturn __no_sanitize_address __section(.text_entry) +__noreturn void barebox_non_pbl_start(unsigned long membase, unsigned long memsize, void *boarddata) { @@ -177,14 +177,3 @@ void barebox_non_pbl_start(unsigned long membase, unsigned long memsize, start_barebox(); } - -void start(unsigned long membase, unsigned long memsize, void *boarddata); -/* - * First function in the uncompressed image. We get here from - * the pbl. The stack already has been set up by the pbl. - */ -void __no_sanitize_address __section(.text_entry) start(unsigned long membase, - unsigned long memsize, void *boarddata) -{ - barebox_non_pbl_start(membase, memsize, boarddata); -} diff --git a/arch/riscv/boot/uncompress.c b/arch/riscv/boot/uncompress.c index d34926c7eba9439aa8794cd0cd6e7d80a774e4e6..73b9cab7ea39bfbdd2184e074d07b0df56ab8b0d 100644 --- a/arch/riscv/boot/uncompress.c +++ b/arch/riscv/boot/uncompress.c @@ -102,7 +102,7 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize, panic("Failed to setup memory protection from ELF: %d\n", ret); } - barebox = (void *)elf.entry; + barebox = (void *)(unsigned long)elf.entry; pr_debug("jumping to uncompressed image at 0x%p. dtb=0x%p\n", barebox, fdt); diff --git a/arch/riscv/lib/barebox.lds.S b/arch/riscv/lib/barebox.lds.S index 77f854e73e2013ca332a0a94fd1deaa2b9978a1d..1435ce3318a466d875d583bab876f63a2368ae69 100644 --- a/arch/riscv/lib/barebox.lds.S +++ b/arch/riscv/lib/barebox.lds.S @@ -14,7 +14,7 @@ #include <asm/barebox.lds.h> OUTPUT_ARCH(BAREBOX_OUTPUT_ARCH) -ENTRY(start) +ENTRY(barebox_non_pbl_start) OUTPUT_FORMAT(BAREBOX_OUTPUT_FORMAT) PHDRS @@ -36,16 +36,11 @@ SECTIONS .text : { _stext = .; - *(.text_entry*) - __bare_init_start = .; - *(.text_bare_init*) - __bare_init_end = .; __exceptions_start = .; KEEP(*(.text_exceptions*)) __exceptions_stop = .; *(.text*) } :text - BAREBOX_BARE_INIT_SIZE . = ALIGN(4096); __start_rodata = .; -- 2.47.3
