summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-01-12 15:21:03 -0800
committerJulius Werner <jwerner@chromium.org>2021-02-18 02:32:28 +0000
commitff61a39e90e0f8cb94a3dd015a2ebd6cae728cc6 (patch)
treea61e4d212aa5ac7522a337151bbea807403c7fbf /util/cbfstool/cbfstool.c
parent84446e6e54fa9df42fcbb8450c9a071feaf1f8d0 (diff)
downloadcoreboot-ff61a39e90e0f8cb94a3dd015a2ebd6cae728cc6.tar.gz
coreboot-ff61a39e90e0f8cb94a3dd015a2ebd6cae728cc6.tar.bz2
coreboot-ff61a39e90e0f8cb94a3dd015a2ebd6cae728cc6.zip
cbfstool: Remove location pointer from parse_elf_to_stage()
The *location argument to parse_elf_to_stage() is a relic from code all the way back to 2009 where this function was still used to parse XIP stages. Nowadays we have a separate parse_elf_to_xip_stage() for that, so there is no need to heed XIP concerns here. Having a pointer to represent the location in flash is absolutely irrelevant to a non-XIP stage, and it is used incorrectly -- we just get lucky that no code path in cbfstool can currently lead to that value being anything other than 0, otherwise the adjustment of data_start to be no lower than *location could easily screw things up. This patch removes it. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ia7f850c0edd7536ed3bef643efaae7271599313d Reviewed-on: https://review.coreboot.org/c/coreboot/+/49369 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 2f920e0988d5..c7330a493e87 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -926,9 +926,10 @@ static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset,
ret = parse_elf_to_xip_stage(buffer, &output, offset,
param.ignore_section);
- } else
+ } else {
ret = parse_elf_to_stage(buffer, &output, param.compression,
- offset, param.ignore_section);
+ param.ignore_section);
+ }
if (ret != 0)
return -1;