[coreboot] New patch to review for coreboot: 05fdc63 Fix the error message for romstage when .bss or .data are non-zero

Ronald G. Minnich (rminnich@gmail.com) gerrit at coreboot.org
Mon Jul 2 18:49:44 CEST 2012


Ronald G. Minnich (rminnich at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1160

-gerrit

commit 05fdc6324a51e2294f466f73a8a82909a071189e
Author: Ronald G. Minnich <rminnich at gmail.com>
Date:   Mon Jul 2 09:46:42 2012 -0700

    Fix the error message for romstage when .bss or .data are non-zero
    
    The error message from romstage is annoying and misleading:
    "Do not use global variables in romstage"
    
    Because it can occur even when global variables are not used
    in some circumstances, but also because it gives you only a rough
    idea where to look. This change sucks but sucks less. We still don't
    know which file the problem is in but at least we know if it is data
    or bss.
    
    Replace the error message with something that provides more information
    and less guessing on the part of the script:
    ".bss is non-zero size in romstage which is not allowed -- global variable?"
    or
    ".data is non-zero size in romstage which is not allowed -- global variable?"
    
    To test: build coreboot as normal. It builds.
    Add
    char d[32];
    to romstage.c and get the first error message; add
    int x = 32;
    to romstage.c and get the second.
    
    Change-Id: I300ec05bdb4b30d7ef3f5112e6cc09b1fafe8263
    Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
---
 src/arch/x86/init/romstage.ld |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/arch/x86/init/romstage.ld b/src/arch/x86/init/romstage.ld
index ca4e820..86093b3 100644
--- a/src/arch/x86/init/romstage.ld
+++ b/src/arch/x86/init/romstage.ld
@@ -53,5 +53,6 @@ SECTIONS
 	}
 
 	_bogus = ASSERT((SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
-	_bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0 || CONFIG_CPU_AMD_AGESA, "Do not use global variables in romstage");
+	_bogus = ASSERT(SIZEOF(.bss) == 0 || CONFIG_CPU_AMD_AGESA, ".bss is non-zero size in romstage which is not allowed -- global variable?");
+	_bogus = ASSERT(SIZEOF(.data) == 0 || CONFIG_CPU_AMD_AGESA, ".data is non-zero size in romstage which is not allowed -- global variable?");
 }




More information about the coreboot mailing list