Author: oxygene
Date: Wed Feb  3 18:56:37 2010
New Revision: 5077
URL: http://tracker.coreboot.org/trac/coreboot/changeset/5077

Log:
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 <[email protected]>
Acked-by: Stefan Reinauer <[email protected]>

Modified:
   trunk/src/arch/i386/Makefile.inc
   trunk/util/cbfstool/cbfs-mkstage.c

Modified: trunk/src/arch/i386/Makefile.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.inc    Wed Feb  3 18:25:34 2010        (r5076)
+++ trunk/src/arch/i386/Makefile.inc    Wed Feb  3 18:56:37 2010        (r5077)
@@ -62,6 +62,10 @@
 #######################################################################
 # 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)

Modified: trunk/util/cbfstool/cbfs-mkstage.c
==============================================================================
--- trunk/util/cbfstool/cbfs-mkstage.c  Wed Feb  3 18:25:34 2010        (r5076)
+++ trunk/util/cbfstool/cbfs-mkstage.c  Wed Feb  3 18:56:37 2010        (r5077)
@@ -126,6 +126,11 @@
                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);
 

-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to