public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Sam Ravnborg <sam@ravnborg.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	torvalds@linux-foundation.org, sam@ravnborg.org, tabbott@MIT.EDU,
	tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/kbuild] x86, vmlinux.lds: unify data output sections
Date: Wed, 29 Apr 2009 09:04:35 GMT	[thread overview]
Message-ID: <tip-1f6397bac55040cd520d9eaf299e155a7aa01d5f@git.kernel.org> (raw)
In-Reply-To: <1240991249-27117-7-git-send-email-sam@ravnborg.org>

Commit-ID:  1f6397bac55040cd520d9eaf299e155a7aa01d5f
Gitweb:     http://git.kernel.org/tip/1f6397bac55040cd520d9eaf299e155a7aa01d5f
Author:     Sam Ravnborg <sam@ravnborg.org>
AuthorDate: Wed, 29 Apr 2009 09:47:23 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 29 Apr 2009 10:20:32 +0200

x86, vmlinux.lds: unify data output sections

For 64 bit the following functional changes are introduced:

 - .data.page_aligned has moved
 - .data.cacheline_aligned has moved
 - .data.read_mostly has moved
 - ALIGN() moved out of output section for .data.cacheline_aligned
 - ALIGN() moved out of output section for .data.page_aligned

Notice that 32 bit and 64 bit has different location of _edata.
.data_nosave is 32 bit only as 64 bit is special due to PERCPU.

[ Impact: 32-bit: cleanup, 64-bit: use 32-bit linker script ]

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Tim Abbott <tabbott@MIT.EDU>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1240991249-27117-7-git-send-email-sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/vmlinux.lds.S    |   55 ++++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/vmlinux_32.lds.S |   37 -------------------------
 arch/x86/kernel/vmlinux_64.lds.S |   28 -------------------
 3 files changed, 55 insertions(+), 65 deletions(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 67164f6..067bdb0 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -104,6 +104,61 @@ SECTIONS
 
 	RODATA
 
+	/* Data */
+	. = ALIGN(PAGE_SIZE);
+	.data : AT(ADDR(.data) - LOAD_OFFSET) {
+		DATA_DATA
+		CONSTRUCTORS
+
+#ifdef CONFIG_X86_64
+		/* End of data section */
+		_edata = .;
+#endif
+	} :data
+
+#ifdef CONFIG_X86_32
+	/* 32 bit has nosave before _edata */
+	. = ALIGN(PAGE_SIZE);
+	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
+		__nosave_begin = .;
+		*(.data.nosave)
+		. = ALIGN(PAGE_SIZE);
+		__nosave_end = .;
+	}
+#endif
+
+	. = ALIGN(PAGE_SIZE);
+	.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
+		*(.data.page_aligned)
+		*(.data.idt)
+	}
+
+#ifdef CONFIG_X86_32
+	. = ALIGN(32);
+#else
+	. = ALIGN(PAGE_SIZE);
+	. = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+#endif
+	.data.cacheline_aligned :
+		AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+		*(.data.cacheline_aligned)
+	}
+
+	/* rarely changed data like cpu maps */
+#ifdef CONFIG_X86_32
+	. = ALIGN(32);
+#else
+	. = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
+#endif
+	.data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
+		*(.data.read_mostly)
+
+#ifdef CONFIG_X86_32
+		/* End of data section */
+		_edata = .;
+#endif
+	}
+
 
 #ifdef CONFIG_X86_32
 # include "vmlinux_32.lds.S"
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 920cc69..8ade846 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -1,40 +1,3 @@
-	/* writeable */
-	. = ALIGN(PAGE_SIZE);
-	/* Data */
-	.data : AT(ADDR(.data) - LOAD_OFFSET) {
-		DATA_DATA
-		CONSTRUCTORS
-	} :data
-
-	. = ALIGN(PAGE_SIZE);
-	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
-		__nosave_begin = .;
-		*(.data.nosave)
-		. = ALIGN(PAGE_SIZE);
-		__nosave_end = .;
-	}
-
-	. = ALIGN(PAGE_SIZE);
-	.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
-		*(.data.page_aligned)
-		*(.data.idt)
-	}
-
-	. = ALIGN(32);
-	.data.cacheline_aligned :
-		AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
-		*(.data.cacheline_aligned)
-	}
-
-	/* rarely changed data like cpu maps */
-	. = ALIGN(32);
-	.data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
-		*(.data.read_mostly)
-
-		/* End of data section */
-		_edata = .;
-	}
-
 	/* init_task */
 	. = ALIGN(THREAD_SIZE);
 	.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 641f3f9..8262701 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -1,26 +1,3 @@
-	/* Align data segment to page size boundary */
-	. = ALIGN(PAGE_SIZE);
-	/* Data */
-	.data : AT(ADDR(.data) - LOAD_OFFSET) {
-		DATA_DATA
-		CONSTRUCTORS
-		/* End of data section */
-		_edata = .;
-	} :data
-
-
-	.data.cacheline_aligned :
-		AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
-		. = ALIGN(PAGE_SIZE);
-		. = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
-		*(.data.cacheline_aligned)
-	}
-
-	. = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
-	.data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
-		*(.data.read_mostly)
-	}
-
 #define VSYSCALL_ADDR (-10*1024*1024)
 #define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \
                             SIZEOF(.data.read_mostly) + 4095) & ~(4095))
@@ -95,11 +72,6 @@
 		*(.data.init_task)
 	} :data.init
 
-	.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
-		. = ALIGN(PAGE_SIZE);
-		*(.data.page_aligned)
-	}
-
 	.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
 		/* might get freed after init */
 		. = ALIGN(PAGE_SIZE);

  reply	other threads:[~2009-04-29  9:08 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29  7:35 [PATCH/RFT 0/13] x86: unify vmlinux.lds Sam Ravnborg
2009-04-29  7:47 ` [PATCH 01/13] x86: beautify vmlinux_32.lds.S Sam Ravnborg
2009-04-29  9:03   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 02/13] x86, vmlinux.lds: unify header/footer Sam Ravnborg
2009-04-29  8:04   ` Ingo Molnar
2009-04-29  8:14     ` Ingo Molnar
2009-04-29  8:25       ` Sam Ravnborg
2009-04-29  8:37         ` Ingo Molnar
2009-04-29  8:51           ` Sam Ravnborg
2009-04-29  9:03   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  9:05   ` [tip:x86/kbuild] x86, vmlinux.lds: add copyright tip-bot for Ingo Molnar
2009-04-29  7:47 ` [PATCH 03/13] x86, vmlinux.lds: unify PHDRS Sam Ravnborg
2009-04-29  9:03   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 04/13] x86, vmlinux.lds: unify start/end of SECTIONS Sam Ravnborg
2009-04-29  9:04   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 05/13] x86, vmlinux.lds: unify .text output sections Sam Ravnborg
2009-04-29  9:04   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 06/13] x86, vmlinux.lds: unify exceptiontable Sam Ravnborg
2009-04-29  9:04   ` [tip:x86/kbuild] x86, vmlinux.lds: unify exception table tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 07/13] x86, vmlinux.lds: unify data output sections Sam Ravnborg
2009-04-29  9:04   ` tip-bot for Sam Ravnborg [this message]
2009-04-29  7:47 ` [PATCH 08/13] x86, vmlinux.lds: move vsyscall " Sam Ravnborg
2009-04-29  9:04   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 09/13] x86, vmlinux.lds: unify first part of initdata Sam Ravnborg
2009-04-29  9:04   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 10/13] x86, vmlinux.lds: unify parainstructions Sam Ravnborg
2009-04-29  9:05   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 11/13] x86, vmlinux.lds: unify .exit.* and .init.ramfs Sam Ravnborg
2009-04-29  9:05   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 12/13] x86, vmlinux.lds: unify percpu Sam Ravnborg
2009-04-29  9:05   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:47 ` [PATCH 13/13] x86, vmlinux.lds: unify remaining parts Sam Ravnborg
2009-04-29  9:05   ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-29  7:57 ` [PATCH/RFT 0/13] x86: unify vmlinux.lds Ingo Molnar
2009-04-29  8:23   ` Sam Ravnborg
2009-04-29  8:31     ` Ingo Molnar
2009-04-29  9:04       ` Ingo Molnar
2009-04-29 10:00   ` Ingo Molnar
2009-04-29 10:50     ` Sam Ravnborg
2009-04-29 10:59       ` Ingo Molnar
2009-04-29 11:05       ` [tip:x86/kbuild] x86, vmlinux.lds: fix relocatable symbols tip-bot for Ingo Molnar
2009-04-29 11:34         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-1f6397bac55040cd520d9eaf299e155a7aa01d5f@git.kernel.org \
    --to=sam@ravnborg.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tabbott@MIT.EDU \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox