From 6f27cd4ad3feeba79cac882ef3f7177224a5935b Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Thu, 8 Jul 2010 19:03:34 +0000 Subject: [PATCH] Remove second zero of BSS 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 Signed-off-by: Tony Breeds --- second/crt0.S | 2 +- second/yaboot.c | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/second/crt0.S b/second/crt0.S index f06fe54..10a8273 100644 --- a/second/crt0.S +++ b/second/crt0.S @@ -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 diff --git a/second/yaboot.c b/second/yaboot.c index 765c7bf..b02070e 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -167,11 +167,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) { @@ -179,9 +174,6 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5) 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.39.2