3GB kernel binary!
Posted: Sat Oct 08, 2005 6:25 pm
Wow, something went really wrong here. For a long time I've been running two parallel builds of my kernel -- one that passes -D NDEBUG to gcc (my "free" build) and one without (my "checked" build). I added -O3 to the compiler settings for my free build, and suddenly my kernel binary grows from 23KB to 3GB!
I'm guessing there is something subtle that I don't understand about my linker script, since my kernel is linked to run in the higher half. Here it is:
Are there any magical sections I'm not aware of that would only show up when compiling with -O3 (or any of the -O's, they all do the same thing)? BTW, I'm using a gcc cross-compiler (built from gcc 3.4.1 sources according to the instructions on the OS FAQ).
I'm guessing there is something subtle that I don't understand about my linker script, since my kernel is linked to run in the higher half. Here it is:
Code: Select all
ENTRY (StartPrecursor)
OUTPUT_FORMAT(binary)
SECTIONS
{
. = 0xC0100000;
.text :
{
*(.text)
*(.rodata)
}
.data ALIGN (0x1000) :
{
*(.data)
}
.bss :
{
_sbss = .;
*(COMMON)
*(.bss)
_ebss = .;
}
}