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/lib64 | |
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/lib64')
-rw-r--r-- | arch/arm/lib64/barebox.lds.S | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S index a53b933bba..fa633e3699 100644 --- a/arch/arm/lib64/barebox.lds.S +++ b/arch/arm/lib64/barebox.lds.S @@ -35,10 +35,10 @@ SECTIONS PRE_IMAGE #endif . = ALIGN(4); + ._text : { *(._text) } .text : { _stext = .; - _text = .; *(.text_entry*) __bare_init_start = .; *(.text_bare_init*) @@ -106,24 +106,20 @@ SECTIONS .dtb : { BAREBOX_DTB() } - .rel.dyn : { - __rel_dyn_start = .; - *(.rel*) - __rel_dyn_end = .; - } + .rel_dyn_start : { *(.__rel_dyn_start) } + .rela.dyn : { *(.rela*) } + .rel_dyn_end : { *(.__rel_dyn_end) } - .dynsym : { - __dynsym_start = .; - *(.dynsym) - __dynsym_end = .; - } + .__dynsym_start : { *(.__dynsym_start) } + .dynsym : { *(.dynsym) } + .__dynsym_end : { *(.__dynsym_end) } _edata = .; . = ALIGN(4); - __bss_start = .; + .__bss_start : { *(.__bss_start) } .bss : { *(.bss*) } - __bss_stop = .; + .__bss_stop : { *(.__bss_stop) } _end = .; _barebox_image_size = __bss_start - TEXT_BASE; } |