From patchwork Tue Dec 11 18:11:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 205279 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB7832C007E for ; Wed, 12 Dec 2012 05:14:50 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TiUIa-0006tK-NZ; Tue, 11 Dec 2012 18:11:20 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TiUIS-0006ry-9e for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2012 18:11:17 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 11 Dec 2012 18:11:10 +0000 Received: from [10.2.201.42] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Dec 2012 18:11:08 +0000 Message-ID: <1355249468.19818.23.camel@hornet> Subject: Re: linker problem with xip kernel and recent toolchains From: Pawel Moll To: Marc Kleine-Budde Date: Tue, 11 Dec 2012 18:11:08 +0000 In-Reply-To: <50C7386E.70305@pengutronix.de> References: <50BE0CDB.5000704@pengutronix.de> <1355230894.19818.1.camel@hornet> <50C7386E.70305@pengutronix.de> X-Mailer: Evolution 3.6.0-0ubuntu3 Mime-Version: 1.0 X-OriginalArrivalTime: 11 Dec 2012 18:11:08.0570 (UTC) FILETIME=[E4CE3FA0:01CDD7CA] X-MC-Unique: 112121118111003801 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121211_131112_543650_5FED72E2 X-CRM114-Status: GOOD ( 15.01 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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 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 Reported-by: Marc Kleine-Budde Tested-by: Marc Kleine-Budde --- 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 = .;