summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/arch/i386/Makefile.inc4
-rw-r--r--util/cbfstool/cbfs-mkstage.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/arch/i386/Makefile.inc b/src/arch/i386/Makefile.inc
index 05f7894..5f7bab6 100644
--- a/src/arch/i386/Makefile.inc
+++ b/src/arch/i386/Makefile.inc
@@ -62,6 +62,10 @@ $(obj)/coreboot.a: $(objs)
#######################################################################
# done
+# crt0s should be set by now
+ifeq ($(crt0s),)
+$(error crt0s are empty. If your board still uses crt0-y and ldscript-y: It shouldn't, we moved away from that in r5065)
+endif
endif
ifeq ($(CONFIG_TINY_BOOTBLOCK),y)
diff --git a/util/cbfstool/cbfs-mkstage.c b/util/cbfstool/cbfs-mkstage.c
index 6e8daef..2f81da0 100644
--- a/util/cbfstool/cbfs-mkstage.c
+++ b/util/cbfstool/cbfs-mkstage.c
@@ -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);
OpenPOWER on IntegriCloud