===================================================================
@@ -157,11 +157,6 @@ extern unsigned char linux_logo_blue[];
#define DEFAULT_TIMEOUT -1
-/* Entry, currently called directly by crt0 (bss not inited) */
-
-extern char* __bss_start;
-extern char* _end;
-
int
yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
{
@@ -169,9 +164,6 @@ yaboot_start (unsigned long r3, unsigned
void* malloc_base = NULL;
prom_handle root;
- /* OF seems to do it, but I'm not very confident */
- memset(&__bss_start, 0, &_end - &__bss_start);
-
/* Initialize OF interface */
prom_init ((prom_entry) r5);
===================================================================
@@ -2,7 +2,7 @@
#include "asm/processor.h"
/*
- * Main entry point. should add code to clear BSS and more ...
+ * Main entry point. We zero the BSS then jump to yaboot_start.
*/
_GLOBAL(_start)
lis r10,edata@h
We zero the BSS in two places: once in _start() and then again in yaboot_start(). The second time we actually get it wrong and zero 1/4 of the BSS (since we subtract two pointers). Since this second zeroing is superfluous and buggy, remove it. While here, fix the comments in _start. It claims we aren't clearing the BSS when we are. Signed-off-by: Anton Blanchard <anton@samba.org> ---