From patchwork Sat Sep 25 11:52:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Avoid globals in romstage Date: Sat, 25 Sep 2010 11:52:07 -0000 From: Patrick Georgi X-Patchwork-Id: 1974 Message-Id: <4C9DE267.5090308@georgi-clan.de> To: coreboot@coreboot.org Hi, attached patch makes globals in romstage a build breaking condition, given that .bss and .data are allocated in ROM areas (ie. non-writable) this is provides some protection against certain coding errors. Signed-off-by: Patrick Georgi Acked-by: Stefan Reinauer Index: src/arch/i386/init/ldscript_fallback_cbfs.lb =================================================================== --- src/arch/i386/init/ldscript_fallback_cbfs.lb (Revision 5839) +++ src/arch/i386/init/ldscript_fallback_cbfs.lb (Arbeitskopie) @@ -49,4 +49,5 @@ *(.comment.*) *(.note.*) } + _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0, "Do not use global variables in romstage"); }