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>
This commit is contained in:
Julius Werner
2021-01-12 15:21:03 -08:00
parent 84446e6e54
commit ff61a39e90
3 changed files with 9 additions and 26 deletions

View File

@@ -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;