summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2025-09-14 10:59:28 +0000
committerTom Rini <[email protected]>2025-09-23 13:35:22 -0600
commita06733fc83f07dd975a9e220a44392f3455c7c21 (patch)
tree9a4c3316bf1104dda3e1550e7775f526adacea62 /tools
parentdade54edaff659c4ed6fc40db0b2dd446714c573 (diff)
binman: Fix FIT image overlap issues for testFitSplitElf
Fix one binman test that has memory region overlap issue, the test case needed to be updated to use non-overlapping memory layouts. * Tests fixed: - testFitSplitElf * Changes made: 1. ELF section layouts: added elf_sections_tee.lds with different address for TEE to avoid overlap with ATF address defined in elf_sections.lds 2. Makefile to properly build elf_sections_tee binary 3. Updat ftest.py to use separate ELF files for TEE vs ATF components in split-elf operations. An upcoming commit will validate if the memory region is overlapped Signed-off-by: Aristo Chen <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/ftest.py2
-rw-r--r--tools/binman/test/Makefile6
l---------tools/binman/test/elf_sections_tee.c1
-rw-r--r--tools/binman/test/elf_sections_tee.lds32
4 files changed, 39 insertions, 2 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 6ed8b8637cd..0252b175242 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -252,7 +252,7 @@ class TestFunctional(unittest.TestCase):
TestFunctional._MakeInputFile('bl31.elf',
tools.read_file(cls.ElfTestFile('elf_sections')))
TestFunctional.tee_elf_path = TestFunctional._MakeInputFile('tee.elf',
- tools.read_file(cls.ElfTestFile('elf_sections')))
+ tools.read_file(cls.ElfTestFile('elf_sections_tee')))
# Newer OP_TEE file in v1 binary format
cls.make_tee_bin('tee.bin')
diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile
index 4d152eee9c0..66279e0e207 100644
--- a/tools/binman/test/Makefile
+++ b/tools/binman/test/Makefile
@@ -30,12 +30,13 @@ LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds
LDS_BINMAN_EMBED := -T $(SRC)u_boot_binman_embed.lds
LDS_EFL_SECTIONS := -T $(SRC)elf_sections.lds
+LDS_EFL_SECTIONS_TEE := -T $(SRC)elf_sections_tee.lds
LDS_BLOB := -T $(SRC)blob_syms.lds
TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data bss_data_zero \
u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
u_boot_binman_syms_size u_boot_binman_syms_x86 embed_data \
- u_boot_binman_embed u_boot_binman_embed_sm elf_sections blob_syms.bin
+ u_boot_binman_embed u_boot_binman_embed_sm elf_sections elf_sections_tee blob_syms.bin
all: $(TARGETS)
@@ -84,6 +85,9 @@ blob_syms: blob_syms.c
elf_sections: CFLAGS += $(LDS_EFL_SECTIONS)
elf_sections: elf_sections.c
+elf_sections_tee: CFLAGS += $(LDS_EFL_SECTIONS_TEE)
+elf_sections_tee: elf_sections_tee.c
+
clean:
rm -f $(TARGETS)
diff --git a/tools/binman/test/elf_sections_tee.c b/tools/binman/test/elf_sections_tee.c
new file mode 120000
index 00000000000..01b200a365e
--- /dev/null
+++ b/tools/binman/test/elf_sections_tee.c
@@ -0,0 +1 @@
+elf_sections.c \ No newline at end of file
diff --git a/tools/binman/test/elf_sections_tee.lds b/tools/binman/test/elf_sections_tee.lds
new file mode 100644
index 00000000000..97e5e5f5d94
--- /dev/null
+++ b/tools/binman/test/elf_sections_tee.lds
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2016 Google, Inc
+ * Copyright (c) 2025 Canonical Ltd.
+ */
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 0x00100010;
+ _start = .;
+
+ . = ALIGN(4);
+ .text :
+ {
+ *(.text*)
+ }
+
+ . = 0x00101000;
+ .sram :
+ {
+ *(.sram*)
+ }
+
+ /DISCARD/ : {
+ *(.comment)
+ *(.dyn*)
+ }
+}