ARM: Fix global_variable_offset() for aarch64
Not all toolchains use pc relative addresses for global variables.
Apparently the gcc 8.3.0 YOCTO toolchain uses absolute addresses.
This means can't simply return 0 for global_variable_offset() but
instead have to calculate the offset between the compile addresses
for global variables and their runtime address.
We do this by getting the address of a global variable pc relative
explicitely in assembly and substracting that address from the
location the C compiler thinks they are.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent af66ec6 commit 1cd4bfe5f6a1766893e15199f37a8ec595a3e9a2
@Sascha Hauer Sascha Hauer authored on 16 Jul 2019
Showing 1 changed file
View
arch/arm/include/asm/barebox-arm.h