diff options
author | Tom Rini <trini@konsulko.com> | 2023-07-20 21:31:31 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-07-20 21:31:31 -0400 |
commit | e896279ac39ebb97f23e6132bf7668a61e1cd86b (patch) | |
tree | 24e035ebd13dbd272da4b3845a1dfcac66e4a86f /tools/binman/elf.py | |
parent | 7fe5accb4516144b7abb8f183640cdf50423121e (diff) | |
parent | 24142ead21ed5e4d2d6f39dd410d91d815ea1ae2 (diff) |
Merge tag 'dm-pull-20jul23' of https://source.denx.de/u-boot/custodians/u-boot-dm
binman mkimage and template enhancements
misc fixes
Diffstat (limited to 'tools/binman/elf.py')
-rw-r--r-- | tools/binman/elf.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/binman/elf.py b/tools/binman/elf.py index 5816284c32..4219001fea 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -248,6 +248,9 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, entry: Entry to process section: Section which can be used to lookup symbol values base_sym: Base symbol marking the start of the image + + Returns: + int: Number of symbols written """ if not base_sym: base_sym = '__image_copy_start' @@ -269,12 +272,13 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, if not syms: tout.debug('LookupAndWriteSymbols: no syms') - return + return 0 base = syms.get(base_sym) if not base and not is_elf: tout.debug('LookupAndWriteSymbols: no base') - return + return 0 base_addr = 0 if is_elf else base.address + count = 0 for name, sym in syms.items(): if name.startswith('_binman'): msg = ("Section '%s': Symbol '%s'\n in entry '%s'" % @@ -307,6 +311,11 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, (msg, name, offset, value, len(value_bytes))) entry.data = (entry.data[:offset] + value_bytes + entry.data[offset + sym.size:]) + count += 1 + if count: + tout.detail( + f"Section '{section.GetPath()}': entry '{entry.GetPath()}' : {count} symbols") + return count def GetSymbolValue(sym, data, msg): """Get the value of a symbol |