diff options
author | Simon Glass <sjg@chromium.org> | 2022-03-05 20:18:57 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-03-18 19:24:25 -0600 |
commit | 17b4ffc56fbd37564099083ed784d1249911629e (patch) | |
tree | 3cd3efad25ba58d1b98c166868c01def866e84e2 /tools/binman/elf.py | |
parent | 0ded4d434dc38031a256eab4428d5e339967dd6b (diff) |
elf: Rename load_segments() and module failure
Rename this function to make it clear that it only reads loadable
segments. Also update the error for missing module to better match the
message emitted by Python.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'tools/binman/elf.py')
-rw-r--r-- | tools/binman/elf.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/binman/elf.py b/tools/binman/elf.py index f24ccd7fb93..afa05e58fdd 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -149,7 +149,7 @@ def GetSymbolFileOffset(fname, patterns): value: Hex value of symbol """ if not ELF_TOOLS: - raise ValueError('Python elftools package is not available') + raise ValueError("Python: No module named 'elftools'") syms = {} with open(fname, 'rb') as fd: @@ -415,7 +415,7 @@ def UpdateFile(infile, outfile, start_sym, end_sym, insert): tools.write_file(outfile, newdata) tout.info('Written to offset %#x' % syms[start_sym].offset) -def read_segments(data): +def read_loadable_segments(data): """Read segments from an ELF file Args: @@ -433,7 +433,7 @@ def read_segments(data): ValueError: elftools is not available """ if not ELF_TOOLS: - raise ValueError('Python elftools package is not available') + raise ValueError("Python: No module named 'elftools'") with io.BytesIO(data) as inf: try: elf = ELFFile(inf) |