From 857f69ba8c66e3b4834bcaafd373a83043629326 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 6 Feb 2017 11:18:07 +0100 Subject: ARM: start: Fix image size calculation In barebox_non_pbl_start() we do not run at the address we are linked at, so we must read linker variables using ld_var(). Since ld_var() current is not available on arm64 we create two zero sized arrays, one at the begin of the image and one at the end. The difference between both is the image size we are looking for. Signed-off-by: Sascha Hauer --- arch/arm/cpu/common.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/cpu') diff --git a/arch/arm/cpu/common.c b/arch/arm/cpu/common.c index 46ce942187..dcd8f0b732 100644 --- a/arch/arm/cpu/common.c +++ b/arch/arm/cpu/common.c @@ -78,3 +78,6 @@ int __pure cpu_architecture(void) return __cpu_architecture; } #endif + +char __image_start[0] __attribute__((section(".__image_start"))); +char __image_end[0] __attribute__((section(".__image_end"))); \ No newline at end of file -- cgit v1.2.3