On 26.08.2008 05:11, ron minnich wrote:
On Mon, Aug 25, 2008 at 5:32 PM, Carl-Daniel Hailfinger
I looked at the code and there's no miscompilation. Current v3 serengeti initram looks like this: int main(void) { printk(BIOS_DEBUG, "Hi there from stage1\n"); post_code(POST_START_OF_MAIN);
printk(BIOS_DEBUG, "stage1 returns\n"); return 0;
}
So the code is a NOP and gcc figured it out. Perfect.
This is the kind of optimization I keep taking for granted, since this is how the Plan 9 linker works. Always interesting to see lots of unused code disappear :-)
Thanks for that info. It seems we could enable --gc-sections in the ld flags and have ld perform garbage collection. However, according to the ld man page, this only applies to complete sections. Can you compile coreboot with the Plan 9 linker and share the results?
Regards, Carl-Daniel