aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/blob.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-11 16:10:17 -0700
committerSimon Glass <sjg@chromium.org>2023-01-18 14:55:41 -0700
commitc1157860c5e9ca45e41859e013ed83919e7397f0 (patch)
treec2b4f1cf8570fcc3e03264e8e105a25674a654e6 /tools/binman/etype/blob.py
parent9766f69c98c2aa056d0518a9545f9e89484e9172 (diff)
binman: Provide general support for updating ELF symbols
The current support for updating variables in a binary is hard-coded to work with U-Boot: - It assumes the image starts at __image_copy_start - It uses the existing U-Boot-specific entry types It is useful for other projects to use these feature. Add properties to enable writing symbols for any blob, a way of specifying the base symbol and a way of providing the ELF filename to allow symbol lookup to take place. With this it is possible to update a Zephyr image, such as zephyr.bin after it has been built. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/blob.py')
-rw-r--r--tools/binman/etype/blob.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index 70dea7158e..c7ddcedffb 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -35,6 +35,12 @@ class Entry_blob(Entry):
super().__init__(section, etype, node,
auto_write_symbols=auto_write_symbols)
self._filename = fdt_util.GetString(self._node, 'filename', self.etype)
+ self.elf_fname = fdt_util.GetString(self._node, 'elf-filename',
+ self.elf_fname)
+ self.elf_base_sym = fdt_util.GetString(self._node, 'elf-base-sym')
+ if not self.auto_write_symbols:
+ if fdt_util.GetBool(self._node, 'write-symbols'):
+ self.auto_write_symbols = True
def ObtainContents(self, fake_size=0):
self._filename = self.GetDefaultFilename()