[PATCH] ppc64: fix Memory: summary line

Anton Blanchard anton at samba.org
Mon Nov 7 17:43:07 EST 2005


On ppc64 we end up with a negative value for the data size in the memory
boot message:

Memory: 2035560k/2097152k available (5792k kernel code, 89564k reserved,
18014398509481632k data, 870k bss, 352k init)

It turns out the section ordering of the linker script is different on
ppc32 and ppc64, so just count data as _edata - _sdata which should work
on both.

Signed-off-by: Anton Blanchard <anton at samba.org>
---

Index: build/arch/powerpc/mm/mem.c
===================================================================
--- build.orig/arch/powerpc/mm/mem.c	2005-11-07 16:56:10.000000000 +1100
+++ build/arch/powerpc/mm/mem.c	2005-11-07 17:24:41.000000000 +1100
@@ -358,7 +358,7 @@
 	}
 
 	codesize = (unsigned long)&_sdata - (unsigned long)&_stext;
-	datasize = (unsigned long)&__init_begin - (unsigned long)&_sdata;
+	datasize = (unsigned long)&_edata - (unsigned long)&_sdata;
 	initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
 	bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
 



More information about the Linuxppc64-dev mailing list