summaryrefslogtreecommitdiff
path: root/tools/binman/elf.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-29 17:59:51 -0400
committerTom Rini <trini@konsulko.com>2019-07-29 17:59:51 -0400
commitde17e1fc03d97d420e9cb59f3a4d0f17c8bdcce5 (patch)
tree3b2d1e382ee75a3d2141d902395c9f3d5f49904e /tools/binman/elf.py
parent333755ef7b6f824366eed37ae068c20a4f25a123 (diff)
parent4f4fb85ec0bfe45da11aa23ada565387ee676e80 (diff)
Merge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman support for replacing files
Diffstat (limited to 'tools/binman/elf.py')
-rw-r--r--tools/binman/elf.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index 8147b3437dd..af40024ceab 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -17,6 +17,7 @@ import struct
import tempfile
import tools
+import tout
ELF_TOOLS = True
try:
@@ -25,9 +26,6 @@ try:
except: # pragma: no cover
ELF_TOOLS = False
-# This is enabled from control.py
-debug = False
-
Symbol = namedtuple('Symbol', ['section', 'address', 'size', 'weak'])
# Information about an ELF file:
@@ -143,9 +141,8 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
value = -1
pack_string = pack_string.lower()
value_bytes = struct.pack(pack_string, value)
- if debug:
- print('%s:\n insert %s, offset %x, value %x, length %d' %
- (msg, name, offset, value, len(value_bytes)))
+ tout.Debug('%s:\n insert %s, offset %x, value %x, length %d' %
+ (msg, name, offset, value, len(value_bytes)))
entry.data = (entry.data[:offset] + value_bytes +
entry.data[offset + sym.size:])