All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/5] ARM: vmlinux.lds.S: replace open coded .data sections with generic macros
Date: Tue, 29 Aug 2017 22:55:45 -0400	[thread overview]
Message-ID: <20170830025547.30347-4-nicolas.pitre@linaro.org> (raw)
In-Reply-To: <20170830025547.30347-1-nicolas.pitre@linaro.org>

Our .data section is missing PAGE_ALIGNED_DATA() which contains,
amongst other things, the vdso page. This creates a System.map that
looks like this:

c15769a8 D _edata
c1577000 d vdso_data_store
c1578000 D __start___bug_table
c1580544 D __stop___bug_table
c1580544 B __bss_start

By using RW_DATA_SECTION() we pick whatever generic sections might be
added in the future and have page-aligned data next to other strongly
aligned data. Furthermore we now include the entire thing, including the
bug table, in the data accounting surrounded by _sdata/_edata.

While at it let's also remplace the open coded .init.data by its
equivalent INIT_DATA_SECTION().

Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
 arch/arm/kernel/vmlinux.lds.S | 38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 4f86b4b7bd..f73ba564b5 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -214,14 +214,9 @@ SECTIONS
 		*(.pv_table)
 		__pv_table_end = .;
 	}
-	.init.data : {
-		INIT_DATA
-		INIT_SETUP(16)
-		INIT_CALLS
-		CON_INITCALL
-		SECURITY_INITCALL
-		INIT_RAM_FS
-	}
+
+	INIT_DATA_SECTION(16)
+
 	.exit.data : {
 		ARM_EXIT_KEEP(EXIT_DATA)
 	}
@@ -237,30 +232,9 @@ SECTIONS
 #endif
 	__init_end = .;
 
-	.data : {
-		_data = .;		/* address in memory */
-		_sdata = .;
-
-		/*
-		 * first, the init task union, aligned
-		 * to an 8192 byte boundary.
-		 */
-		INIT_TASK_DATA(THREAD_SIZE)
-
-		NOSAVE_DATA
-		CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
-		READ_MOSTLY_DATA(L1_CACHE_BYTES)
-
-		/*
-		 * and the usual data section
-		 */
-		DATA_DATA
-		CONSTRUCTORS
-
-		_edata = .;
-	}
-
-	BUG_TABLE
+	_sdata = .;
+	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
+	_edata = .;
 
 #ifdef CONFIG_HAVE_TCM
         /*
-- 
2.9.5

  parent reply	other threads:[~2017-08-30  2:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  2:55 [PATCH v2 0/5] make XIP kernel .data compressed in ROM Nicolas Pitre
2017-08-30  2:55 ` [PATCH v2 1/5] ARM: head-common.S: speed up startup code Nicolas Pitre
2017-10-03 12:41   ` Geert Uytterhoeven
2017-10-03 12:41     ` Geert Uytterhoeven
2017-10-03 13:15     ` Ard Biesheuvel
2017-10-03 13:15       ` Ard Biesheuvel
2017-10-03 15:24       ` Geert Uytterhoeven
2017-10-03 15:24         ` Geert Uytterhoeven
2017-08-30  2:55 ` [PATCH v2 2/5] ARM: vmlinux*.lds.S: some decruftification Nicolas Pitre
2017-08-30  2:55 ` Nicolas Pitre [this message]
2017-08-30 15:11   ` [PATCH v2 3/5] ARM: vmlinux.lds.S: replace open coded .data sections with generic macros Ard Biesheuvel
2017-08-30  2:55 ` [PATCH v2 4/5] ARM: vmlinux-xip.lds.S: fix multiple issues Nicolas Pitre
2017-08-30 15:12   ` Ard Biesheuvel
2017-08-30  2:55 ` [PATCH v2 5/5] ARM: XIP kernel: store .data compressed in ROM Nicolas Pitre
2017-08-30 21:58 ` [PATCH v2 0/5] make XIP kernel " Chris Brandt
2017-08-31  0:04   ` Nicolas Pitre
2017-08-31  0:43     ` Chris Brandt
2017-08-31  1:02       ` Nicolas Pitre

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=20170830025547.30347-4-nicolas.pitre@linaro.org \
    --to=nicolas.pitre@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.