Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sh
[oweals/u-boot.git] / tools / binman / elf.py
index 7bc7cf61b5d83721cbd73e093fd40d6619889520..f88031c2bf97c19874eb2a7ae596c7ba3cfe04ba 100644 (file)
@@ -5,10 +5,7 @@
 # Handle various things related to ELF images
 #
 
-from __future__ import print_function
-
 from collections import namedtuple, OrderedDict
-import command
 import io
 import os
 import re
@@ -16,8 +13,9 @@ import shutil
 import struct
 import tempfile
 
-import tools
-import tout
+from patman import command
+from patman import tools
+from patman import tout
 
 ELF_TOOLS = True
 try:
@@ -134,10 +132,8 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
                                  (msg, sym.size))
 
             # Look up the symbol in our entry tables.
-            value = section.LookupSymbol(name, sym.weak, msg)
-            if value is not None:
-                value += base.address
-            else:
+            value = section.LookupSymbol(name, sym.weak, msg, base.address)
+            if value is None:
                 value = -1
                 pack_string = pack_string.lower()
             value_bytes = struct.pack(pack_string, value)