diff options
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r-- | tools/binman/entry.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 63ec5cea3b2..bdf53ddd922 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -12,6 +12,7 @@ import sys import time from binman import bintool +from binman import elf from dtoc import fdt_util from patman import tools from patman.tools import to_hex, to_hex_size @@ -86,10 +87,15 @@ class Entry(object): fake_fname: Fake filename, if one was created, else None required_props (dict of str): Properties which must be present. This can be added to by subclasses + elf_fname (str): Filename of the ELF file, if this entry holds an ELF + file, or is a binary file produced from an ELF file + auto_write_symbols (bool): True to write ELF symbols into this entry's + contents """ fake_dir = None - def __init__(self, section, etype, node, name_prefix=''): + def __init__(self, section, etype, node, name_prefix='', + auto_write_symbols=False): # Put this here to allow entry-docs and help to work without libfdt global state from binman import state @@ -125,6 +131,8 @@ class Entry(object): self.fake_fname = None self.required_props = [] self.comp_bintool = None + self.elf_fname = None + self.auto_write_symbols = auto_write_symbols @staticmethod def FindEntryClass(etype, expanded): @@ -647,7 +655,8 @@ class Entry(object): Args: section: Section containing the entry """ - pass + if self.auto_write_symbols: + elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage()) def CheckEntries(self): """Check that the entry offsets are correct |