[PATCH 6/8] binman: Provide general support for updating ELF symbols

Simon Glass sjg at chromium.org
Thu Jan 19 03:11:32 CET 2023


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 at chromium.org>
---

 tools/binman/binman.rst               | 25 ++++++++++++++++++++++
 tools/binman/elf.py                   |  8 +++++--
 tools/binman/entry.py                 |  3 ++-
 tools/binman/etype/blob.py            |  6 ++++++
 tools/binman/etype/u_boot_spl.py      |  1 -
 tools/binman/ftest.py                 | 19 +++++++++++++++++
 tools/binman/test/273_blob_symbol.dts | 24 +++++++++++++++++++++
 tools/binman/test/Makefile            |  9 +++++++-
 tools/binman/test/blob_syms.c         | 20 ++++++++++++++++++
 tools/binman/test/blob_syms.lds       | 30 +++++++++++++++++++++++++++
 10 files changed, 140 insertions(+), 5 deletions(-)
 create mode 100644 tools/binman/test/273_blob_symbol.dts
 create mode 100644 tools/binman/test/blob_syms.c
 create mode 100644 tools/binman/test/blob_syms.lds

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list