linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pawel.moll@arm.com (Pawel Moll)
To: linux-arm-kernel@lists.infradead.org
Subject: linker problem with xip kernel and recent toolchains
Date: Tue, 11 Dec 2012 18:11:08 +0000	[thread overview]
Message-ID: <1355249468.19818.23.camel@hornet> (raw)
In-Reply-To: <50C7386E.70305@pengutronix.de>

On Tue, 2012-12-11 at 13:43 +0000, Marc Kleine-Budde wrote:
> What about putting the notes section into the read only segment, i.e.
> the ROM?

Could you, please, try the change below? It seems to do the job for me.

Pawe?

8<-------------------------
>From 01fe7810cfded11aff03d216d2adbcf673e78f65 Mon Sep 17 00:00:00 2001
From: Pawel Moll <pawel.moll@arm.com>
Date: Tue, 11 Dec 2012 18:09:14 +0000
Subject: [PATCH] ARM: vmlinux.lds: Move .notes section next to the rodata

The .notes, being read-only data by nature, was placed between
read-write .data and .bss. This was harmful in case of XIP
images, as it was placed in the RAM range, most likely far
from the ROM address, inflating the XIP images.

Moving the .notes at the end of the read-only section
(consisting of .text, .rodata and unwind info) fixes the problem.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 arch/arm/kernel/vmlinux.lds.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 36ff15b..31fa80e 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -131,6 +131,8 @@ SECTIONS
 	}
 #endif
 
+	NOTES
+
 	_etext = .;			/* End of text and rodata section */
 
 #ifndef CONFIG_XIP_KERNEL
@@ -296,8 +298,6 @@ SECTIONS
 	}
 #endif
 
-	NOTES
-
 	BSS_SECTION(0, 0, 0)
 	_end = .;
 
-- 
1.7.10.4

  parent reply	other threads:[~2012-12-11 18:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 14:46 linker problem with xip kernel and recent toolchains Marc Kleine-Budde
2012-12-11 13:01 ` Pawel Moll
2012-12-11 13:43   ` Marc Kleine-Budde
2012-12-11 13:52     ` Pawel Moll
2012-12-11 18:11     ` Pawel Moll [this message]
2012-12-12  8:22       ` Marc Kleine-Budde
2012-12-12  8:44         ` Baruch Siach
2012-12-12  8:49           ` Marc Kleine-Budde
2012-12-13 13:20         ` Pawel Moll

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=1355249468.19818.23.camel@hornet \
    --to=pawel.moll@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).