[U-Boot] [PATCH] Revert "binman: Correct symbol calculation with non-zero image base"

Stephen Warren swarren at wwwdotorg.org
Tue Nov 5 16:21:02 UTC 2019


From: Stephen Warren <swarren at nvidia.com>

This reverts commit 15c981cc8adc26501e3a19ca7fb35705870ef597.
"binman: Correct symbol calculation with non-zero image base". This
was previously reported to break initial boot on Jetson TK1, and Simon
dropped the patch from his branch. However, it seems to have shown up
again in a pull request somehow. Revert it until the problem is fixed.

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 tools/binman/elf.py                      | 4 +++-
 tools/binman/test/u_boot_binman_syms.lds | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index 0c1a5b44b669..7bc7cf61b5d8 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -135,7 +135,9 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
 
             # Look up the symbol in our entry tables.
             value = section.LookupSymbol(name, sym.weak, msg)
-            if value is None:
+            if value is not None:
+                value += base.address
+            else:
                 value = -1
                 pack_string = pack_string.lower()
             value_bytes = struct.pack(pack_string, value)
diff --git a/tools/binman/test/u_boot_binman_syms.lds b/tools/binman/test/u_boot_binman_syms.lds
index 825fc3f649f7..926df873cb70 100644
--- a/tools/binman/test/u_boot_binman_syms.lds
+++ b/tools/binman/test/u_boot_binman_syms.lds
@@ -9,7 +9,7 @@ ENTRY(_start)
 
 SECTIONS
 {
-	. = 0x00000010;
+	. = 0x00000000;
 	_start = .;
 
 	. = ALIGN(4);
-- 
2.23.0



More information about the U-Boot mailing list