[U-Boot,32/34] binman: Write symbol info before image inclusion
diff mbox series

Message ID 20190824132315.53130-33-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show
Series
  • binman: Various improvements and tidy-ups
Related show

Commit Message

Simon Glass Aug. 24, 2019, 1:23 p.m. UTC
At present the symbol information is written to binaries just before
binman exits. This is fine for entries within sections since the section
contents is calculated when it is needed, so the updated symbol values are
included in the image that is written.

However some binaries are inside entries which have already generated
their contents and do not notice that the entries have changed (e.g. Intel
IFWI).

Move the symbol writing earlier to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Sept. 27, 2019, 12:38 a.m. UTC | #1
At present the symbol information is written to binaries just before
binman exits. This is fine for entries within sections since the section
contents is calculated when it is needed, so the updated symbol values are
included in the image that is written.

However some binaries are inside entries which have already generated
their contents and do not notice that the entries have changed (e.g. Intel
IFWI).

Move the symbol writing earlier to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

Patch
diff mbox series

diff --git a/tools/binman/control.py b/tools/binman/control.py
index 43f5d49406..07dffbd89c 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -434,6 +434,7 @@  def ProcessImage(image, update_fdt, write_map, get_contents=True,
             for dtb_item in state.GetAllFdts():
                 dtb_item.Sync()
                 dtb_item.Flush()
+        image.WriteSymbols()
         sizes_ok = image.ProcessEntryContents()
         if sizes_ok:
             break
@@ -442,7 +443,6 @@  def ProcessImage(image, update_fdt, write_map, get_contents=True,
         image.Raise('Entries changed size after packing (tried %s passes)' %
                     passes)
 
-    image.WriteSymbols()
     image.BuildImage()
     if write_map:
         image.WriteMap()