switch-coreboot/util
Carl-Daniel Hailfinger df65052e93 v3 does not handle .data* and .bss sections in stage1 and initram. We
simply hope they are unused/empty and will get runtime crashes/
corruption/malfunction if they are not empty. Same applies to any
sections with relocation entries which can not be resolved during
link time.

Check for the emptiness of these sections and abort the build on error.
This triggers on all stage1/initram global variables which are not
declared the right way. It also triggers on local static variables.

Features of this checker:
- It doesn't only check for non-empty .data and .bss, but also for
unknown sections which would be a problem.
- It gives you the offending filename, the section and the variable
  name.
- It won't stop after the first error and will tell you about all errors
for a given file list.

This found a long-standing bug introduced in r729 and fixed in r786.
It also broke the build of every Geode target in the v3 tree because
they had multiple bugs. And it broke the build of the K8 code because
of a bug there.
Other fixes resulting from this checker are in r790 and r791.

Ron already fixed some of the bugs uncovered by this checker.

Tested for all possible variations of .data and .bss usage.

Sample output follows:
  CC      build/coreboot.initram (XIP)
  CHECK   initram (non-empty writable/allocatable sections)
build/coreboot.initram_partiallylinked.o: section .data: foo1
build/coreboot.initram_partiallylinked.o: section .bss: foo2
build/coreboot.initram_partiallylinked.o: section .data.rel.ro.local:
msrnames.2746
make: *** [build/coreboot.initram] Error 1

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org> 


git-svn-id: svn://coreboot.org/repository/coreboot-v3@794 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 17:43:04 +00:00
..
doxygen doxy: Fix doxygen build by renaming Doxyfile file from .LinuxBIOS to .coreboot, as the reference in build system was already changed to Doxyfile.coreboot back in January 27th 2008-05-22 15:52:33 +00:00
dtc Add support for dtc files that end in .dtc, e.g. ide.dtc. 2008-08-11 16:05:53 +00:00
kconfig Order libraries last on the command line when 2008-06-06 20:47:42 +00:00
lar This very short patch fixes nrv2b compression in lar. 2008-04-14 14:19:09 +00:00
lxregs The Geode has MSRs. LOTS of MSR. I get confused trying to find them. 2008-05-09 16:12:41 +00:00
lzma This very short patch fixes nrv2b compression in lar. 2008-04-14 14:19:09 +00:00
nrv2b This very short patch fixes nrv2b compression in lar. 2008-04-14 14:19:09 +00:00
options Emergency patch so that section checker won't bounce option tables. 2008-08-21 15:49:29 +00:00
picwrapper Fix typo in comment: 2008-08-16 13:27:05 +00:00
sectionchecker v3 does not handle .data* and .bss sections in stage1 and initram. We 2008-08-21 17:43:04 +00:00
x86emu The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
xcompile fix i386-elf binutils weirdness. Thanks to Segher Boessenkool for finding this 2008-04-04 23:38:51 +00:00
Makefile Now version 3: LinuxBIOS -> coreboot rename. 2008-01-27 18:54:57 +00:00