Skip to contentSkip to conversation

x86: Provide _sdata in the vmlinux_*.lds.S files

PATCH In review Catalin Marinas 2 participants 2 messages May 7, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Provide _sdata in the vmlinux_*.lds.S files

_sdata is a common symbol defined by many architectures and made available to the kernel via asm-generic/sections.h. Kmemleak uses this symbol when scanning the data sections. The _edata symbol in vmlinux_64.lds.S was also moved further down to include the .data.read_mostly section.

---
 arch/x86/kernel/vmlinux_32.lds.S |    1 +
 arch/x86/kernel/vmlinux_64.lds.S |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kernel/vmlinux_32.lds.S +1 -0
index 62ad500..181bd49 100644
@@ -64,6 +64,7 @@ SECTIONS
   /* writeable */
   . = ALIGN(PAGE_SIZE);
   .data : AT(ADDR(.data) - LOAD_OFFSET) {	/* Data */
+	_sdata = .;		/* Start of data section */
 	DATA_DATA
 	CONSTRUCTORS
 	} :data
arch/x86/kernel/vmlinux_64.lds.S +2 -1
index c874250..4398a91 100644
@@ -59,9 +59,9 @@ SECTIONS
   . = ALIGN(PAGE_SIZE);		/* Align data segment to page size boundary */
 				/* Data */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {
+	_sdata = .;			/* Start of data section */
 	DATA_DATA
 	CONSTRUCTORS
-	_edata = .;			/* End of data section */
 	} :data
 
 
@@ -73,6 +73,7 @@ SECTIONS
   . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
   .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
   	*(.data.read_mostly)
+	_edata = .;			/* End of data section */
   }
 
 #define VSYSCALL_ADDR (-10*1024*1024)
#1 lore raw
Quoted 6 lines · Catalin Marinas

_sdata is a common symbol defined by many architectures and made available to the kernel via asm-generic/sections.h. Kmemleak uses this symbol when scanning the data sections. The _edata symbol in vmlinux_64.lds.S was also moved further down to include the .data.read_mostly section.

Quoted 6 lines
---
 arch/x86/kernel/vmlinux_32.lds.S |    1 +
 arch/x86/kernel/vmlinux_64.lds.S |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

Please do this against the latest x86 tree:

http://people.redhat.com/mingo/tip.git/README

Ingo