Guards against errors that are hard to track down:
- if crt0s is empty (eg. because crt0-y is still used), break the build, and say where that behaviour changed - if a stage is unusable for cbfstool because it's placed outside the ROM space (linked to 0 is somewhat notorious), warn about it, give some hints and exit instead of crashing. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stefan.reinauer@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5077 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -126,6 +126,11 @@ int parse_elf_to_stage(unsigned char *input, unsigned char **output,
|
||||
data_start = *location;
|
||||
}
|
||||
|
||||
if (data_end <= data_start) {
|
||||
fprintf(stderr, "E: data ends before it starts. Make sure the ELF file is correct and resides in ROM space.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* allocate an intermediate buffer for the data */
|
||||
buffer = calloc(data_end - data_start, 1);
|
||||
|
||||
|
Reference in New Issue
Block a user