binman: Write symbol info before image inclusion
authorSimon Glass <sjg@chromium.org>
Sat, 24 Aug 2019 13:23:12 +0000 (07:23 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:02 +0000 (08:40 -0600)
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

index 8268eda37eae5c2f50997287dca26e8bb6ba7be8..fe24b2a6a73ff6c88b2987c669ec3d84a42d21d8 100644 (file)
@@ -437,6 +437,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
@@ -445,7 +446,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()