binman: Support writing symbols into ELF files
In some cases the ELF version of SPL builds may be packaged, rather
than a binary .bin file. Add support for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index bdf53dd..1be31a0 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -656,7 +656,10 @@
section: Section containing the entry
"""
if self.auto_write_symbols:
- elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage())
+ # Check if we are writing symbols into an ELF file
+ is_elf = self.GetDefaultFilename() == self.elf_fname
+ elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage(),
+ is_elf)
def CheckEntries(self):
"""Check that the entry offsets are correct