From: Simon Glass Date: Mon, 26 Aug 2024 19:11:39 +0000 (-0600) Subject: binman: Add minor improvements to symbol-writing X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=01a609930b996499b36418108125ee53ab7094b5;p=u-boot.git binman: Add minor improvements to symbol-writing Add a clarification to the documentation and add a missing comment. Also update the test so that when it fails it is easier to see what is going on, rather than having to decode hex strings. Signed-off-by: Simon Glass --- diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst index 0cafc36bdc..04564f4f66 100644 --- a/tools/binman/binman.rst +++ b/tools/binman/binman.rst @@ -494,7 +494,9 @@ point into the image. For example, say SPL is at the start of the image and linked to start at address 80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded -to 80108000, with SPL at 80108000 and U-Boot at 80110000. +to 80108000, with SPL at 80108000 and U-Boot at 80110000. In other words, the +positions are calculated relative to the start address of the image to which +they are being written. For x86 devices (with the end-at-4gb property) this base address is not added since it is assumed that images are XIP and the offsets already include the diff --git a/tools/binman/elf.py b/tools/binman/elf.py index 1c3b1e225f..73394830eb 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -247,7 +247,8 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, entry entry: Entry to process section: Section which can be used to lookup symbol values - base_sym: Base symbol marking the start of the image + base_sym: Base symbol marking the start of the image (__image_copy_start + by default) Returns: int: Number of symbols written diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index b133c76188..7b4454bd34 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1526,18 +1526,40 @@ class TestFunctional(unittest.TestCase): # The image should contain the symbols from u_boot_binman_syms.c # Note that image_pos is adjusted by the base address of the image, # which is 0x10 in our test image - sym_values = struct.pack('