summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-09 08:46:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-21 12:23:00 +0100
commit47ea1f6b6df92fdb8dfff8afae1335092383d8fc (patch)
tree7a73ca309a85a8a158b38c6b8224351af888e477 /arch/arm/lib
parentf382224173ebf8a7fce42cf09179b5f6bc7dc6c9 (diff)
downloadbarebox-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/lib')
-rw-r--r--arch/arm/lib/pbl.lds.S22
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S
index 7de7791b71..be0a4a3b1a 100644
--- a/arch/arm/lib/pbl.lds.S
+++ b/arch/arm/lib/pbl.lds.S
@@ -34,10 +34,10 @@ SECTIONS
PRE_IMAGE
. = ALIGN(4);
+ ._text : { *(._text) }
.text :
{
_stext = .;
- _text = .;
*(.text_head_entry*)
__bare_init_start = .;
*(.text_bare_init*)
@@ -61,22 +61,18 @@ SECTIONS
. = ALIGN(4);
.data : { *(.data*) }
- .rel.dyn : {
- __rel_dyn_start = .;
- *(.rel*)
- __rel_dyn_end = .;
- }
+ .rel_dyn_start : { *(.__rel_dyn_start) }
+ .rel.dyn : { *(.rel*) }
+ .rel_dyn_end : { *(.__rel_dyn_end) }
- .dynsym : {
- __dynsym_start = .;
- *(.dynsym)
- __dynsym_end = .;
- }
+ .__dynsym_start : { *(.__dynsym_start) }
+ .dynsym : { *(.dynsym) }
+ .__dynsym_end : { *(.__dynsym_end) }
. = ALIGN(4);
- __bss_start = .;
+ .__bss_start : { *(.__bss_start) }
.bss : { *(.bss*) }
- __bss_stop = .;
+ .__bss_stop : { *(.__bss_stop) }
_end = .;
. = ALIGN(4);