Patchwork [1/2] powerpc/vmlinux.lds: Move _edata down

login
register
mail settings
Submitter Michael Ellerman
Date Aug. 10, 2009, 5:06 a.m.
Message ID <ab02e115992881a734e8e90b7d3f2d8617db4bf2.1249880775.git.michael@ellerman.id.au>
Download mbox | patch
Permalink /patch/31067/
State Accepted
Commit 903444e4297264ec0959e886695911659edb425c
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Michael Ellerman - Aug. 10, 2009, 5:06 a.m.
Currently _edata does not include several data sections, this causes
the kernel's report of memory usage at boot to not match reality, and
also prevents kmemleak from working - because it scan between _sdata
and _edata for pointers to allocated memory.

This mirrors a similar change made recently to the x86 linker script.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/kernel/vmlinux.lds.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 8ef8a14..3bb0997 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -245,10 +245,6 @@  SECTIONS
 	}
 #endif
 
-	. = ALIGN(PAGE_SIZE);
-	_edata  =  .;
-	PROVIDE32 (edata = .);
-
 	/* The initial task and kernel stack */
 #ifdef CONFIG_PPC32
 	. = ALIGN(8192);
@@ -282,6 +278,10 @@  SECTIONS
 		__nosave_end = .;
 	}
 
+	. = ALIGN(PAGE_SIZE);
+	_edata  =  .;
+	PROVIDE32 (edata = .);
+
 /*
  * And finally the bss
  */