summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/sections.c1
-rw-r--r--arch/arm/cpu/uncompress.c18
2 files changed, 7 insertions, 12 deletions
diff --git a/arch/arm/cpu/sections.c b/arch/arm/cpu/sections.c
index ab08ebf42e..a53236d900 100644
--- a/arch/arm/cpu/sections.c
+++ b/arch/arm/cpu/sections.c
@@ -10,4 +10,3 @@ char __bss_start[0] __attribute__((section(".__bss_start")));
char __bss_stop[0] __attribute__((section(".__bss_stop")));
char __image_start[0] __attribute__((section(".__image_start")));
char __image_end[0] __attribute__((section(".__image_end")));
-uint32_t __image_end_marker[1] __attribute__((section(".__image_end_marker"))) = { 0xdeadbeef };
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c
index 048bca0c95..be92bda4e8 100644
--- a/arch/arm/cpu/uncompress.c
+++ b/arch/arm/cpu/uncompress.c
@@ -37,6 +37,9 @@
unsigned long free_mem_ptr;
unsigned long free_mem_end_ptr;
+extern unsigned char input_data[];
+extern unsigned char input_data_end[];
+
void __noreturn barebox_multi_pbl_start(unsigned long membase,
unsigned long memsize, void *boarddata)
{
@@ -44,11 +47,11 @@ void __noreturn barebox_multi_pbl_start(unsigned long membase,
void __noreturn (*barebox)(unsigned long, unsigned long, void *);
unsigned long endmem = membase + memsize;
unsigned long barebox_base;
- uint32_t *image_end;
- void *pg_start;
+ void *pg_start, *pg_end;
unsigned long pc = get_pc();
- image_end = (void *)__image_end_marker + global_variable_offset();
+ pg_start = input_data + global_variable_offset();
+ pg_end = input_data_end + global_variable_offset();
if (IS_ENABLED(CONFIG_PBL_RELOCATABLE)) {
/*
@@ -62,14 +65,7 @@ void __noreturn barebox_multi_pbl_start(unsigned long membase,
relocate_to_adr(membase);
}
- /*
- * image_end is the image_end_marker defined above. It is the last location
- * in the executable. Right after the executable the build process adds
- * the size of the appended compressed binary followed by the compressed
- * binary itself.
- */
- pg_start = image_end + 2;
- pg_len = *(image_end + 1);
+ pg_len = pg_end - pg_start;
uncompressed_len = get_unaligned((const u32 *)(pg_start + pg_len - 4));
if (IS_ENABLED(CONFIG_RELOCATABLE))