[PATCH v2 05/10] mach-snapdragon: add u-boot-spl-elf-sdm845.lds

michael.srba
2026-04-11T07:11:43Z

From: Michael Srba <Michael.Srba@seznam.cz>

This custom linker script is required to produce a bootable ELF
for the sdm845 SoC. An xbl_sec.elf must be provided, which will
be put in a section in the ELF as required by the boot rom.

Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
---
arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds b/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds
new file mode 100644
index 00000000000..10912f416cc
--- /dev/null
+++ b/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds
@@ -0,0 +1,25 @@
+TARGET("binary")
+INPUT("./xbl_sec.elf")
+
+OUTPUT_FORMAT("default")
+
+ENTRY(CONFIG_PLATFORM_ELFENTRY)
+PHDRS
+{
+ data PT_LOAD FLAGS(7);
+ xbl_sec PT_LOAD FLAGS(5 | (0x5 << 24));
+}
+SECTIONS
+{
+ . = 0x0000000014699000;
+ .xbl_sec : { // XBL_SEC nested ELF
+ . = .;
+ "./xbl_sec.elf"
+ } :xbl_sec
+
+ . = CONFIG_PLATFORM_ELFENTRY;
+
+ .data : {
+ *(.data*)
+ } :data
+}

--
2.53.0