coreboot/util
Carl-Daniel Hailfinger 48fe3ab5ef Current v3 code has a big problem: Shared functions.
Calling non-PIC code from PIC code needs an ABI wrapper and we don't
provide one. Our trick with function pointers is exceedingly fragile:
- it depends on gcc not being clever enough
- it forces us to compile all initram source files in one go
- parallelizing initram compilation breaks the code
- compiling one initram source file at a time breaks the code
- enabling higher optimizations breaks the code
- enabling -fwhole-program breaks the code
- declaring the function pointers const breaks the code
- it's an undocumented side effect of gcc which will go away
- we need excessively ugly shared function wrappers
- the shared function wrappers had more than their fair share of bugs
- almost nobody understands the wrappers completely
- Segher warns against them: "So why do you think this should work?
You're telling it to link PIC to non-PIC. Did you read the manual? It's
just not allowed. It cannot ever work."

Kill the SHARED wrappers and use a real ABI wrapper.
The wrapper code is autogenerated on demand.
Any function compiled into stage0 is now shared by default, yet the size
and code generation of stage0/1/2 code are unchanged. Initram code size
does decrease quite a bit and the difficulty of creating shared
functions is now zero.

The patch includes extensive documentation about the inner workings of
the new wrappers and the reasons why they look like this.

Build and boot tested on qemu.
Build tested on all targets.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Ron says:
Wow. we've need this fix for a long time.

Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@775 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-16 00:10:25 +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 commit as I have broken this tool. 2008-08-13 03:07:21 +00:00
picwrapper Current v3 code has a big problem: Shared functions. 2008-08-16 00:10:25 +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