From: Simon Glass Date: Fri, 21 Oct 2022 00:22:44 +0000 (-0600) Subject: binman: Allow obtaining a symbol value X-Git-Tag: v2025.01-rc5-pxa1908~1227^2~36 X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20.Permalink%20%7D%7D?a=commitdiff_plain;h=28565796df769e0a8d5ab1f8424cb262e40edc2e;p=u-boot.git binman: Allow obtaining a symbol value Provide a function to obtain the integer value of an ELF symbol. This will be used Signed-off-by: Simon Glass --- diff --git a/tools/binman/elf.py b/tools/binman/elf.py index 6d440ddf21..fec2116880 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -188,6 +188,28 @@ def GetSymbolAddress(fname, sym_name): return None return sym.address +def GetPackString(sym, msg): + """Get the struct.pack/unpack string to use with a given symbol + + Args: + sym (Symbol): Symbol to check. Only the size member is checked + @msg (str): String which indicates the entry being processed, used for + errors + + Returns: + str: struct string to use, .e.g. '