From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Date: Sat, 29 Jan 2022 15:27:03 +0000 (+0300)
Subject: armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER
X-Git-Tag: v2025.01-rc5-pxa1908~1549^2~7
X-Git-Url: http://git.dujemihanovic.xyz/repo?a=commitdiff_plain;h=22eb7ba80e8789867bb1a103e1aa61765d6b0865;p=u-boot.git

armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER

Setting LINUX_KERNEL_IMAGE_HEADER=y attempts to include an ARM64 Linux
kernel image header at the start of both U-Boot proper and SPL binaries.
However, some definitions that the image header uses are not included by
the SPL linker script, resulting in a build error. Include them the way
they are included in U-Boot proper's linker script to fix the error.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---

diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds
index 9edb662b09..730eb93dbc 100644
--- a/arch/arm/cpu/armv8/u-boot-spl.lds
+++ b/arch/arm/cpu/armv8/u-boot-spl.lds
@@ -84,4 +84,8 @@ SECTIONS
 	/DISCARD/ : { *(.plt*) }
 	/DISCARD/ : { *(.interp*) }
 	/DISCARD/ : { *(.gnu*) }
+
+#ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
+#include "linux-kernel-image-header-vars.h"
+#endif
 }