diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-09 08:46:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-21 12:23:00 +0100 |
commit | 47ea1f6b6df92fdb8dfff8afae1335092383d8fc (patch) | |
tree | 7a73ca309a85a8a158b38c6b8224351af888e477 /arch/arm/boards/friendlyarm-tiny210 | |
parent | f382224173ebf8a7fce42cf09179b5f6bc7dc6c9 (diff) | |
download | barebox-47ea1f6b6df92fdb8dfff8afae1335092383d8fc.tar.gz barebox-47ea1f6b6df92fdb8dfff8afae1335092383d8fc.tar.xz |
ARM: move away from ld_var
The ld_var solves the issue that when compiled with -pie the linker
provided variables are all 0x0. This mechanism however refuses to
compile with aarch64 support.
This patch replaces the ld_var mechanism with a nice little trick
learned from U-Boot: Instead of using linker provided variables
directly with "__bss_start = ." we put a zero size array into
a separate section and use the address of that array instead of
the linker variable. This properly works before relocation.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/friendlyarm-tiny210')
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny210/lowlevel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c index fea00ef503..4b9ba87d70 100644 --- a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c +++ b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c @@ -96,7 +96,7 @@ void __bare_init barebox_arm_reset_vector(void) debug_led(1, 1); - if (! load_stage2((void*)(ld_var(_text) - 16), + if (! load_stage2((void*)(_text - 16), barebox_image_size + 16)) { debug_led(3, 1); while (1) { } /* hang */ @@ -104,7 +104,7 @@ void __bare_init barebox_arm_reset_vector(void) debug_led(2, 1); - jump_sdram(IRAM_CODE_BASE - ld_var(_text)); + jump_sdram(IRAM_CODE_BASE - (unsigned long)_text); debug_led(1, 0); |