From patchwork Tue Dec 4 14:46:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 1838551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 45D8BDF230 for ; Tue, 4 Dec 2012 14:49:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tftm7-00065r-2i; Tue, 04 Dec 2012 14:47:07 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tftm3-000651-Nf for linux-arm-kernel@lists.infradead.org; Tue, 04 Dec 2012 14:47:05 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:6f8:1178:4:5054:ff:fe8d:eefb] helo=bjornoya.do.blackshift.org) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Tftly-0003uv-9h; Tue, 04 Dec 2012 15:46:58 +0100 Received: from [IPv6:2001:6f8:105b:1122:21d:e0ff:fe39:f61b] (hardanger.wlan.blackshift.org [IPv6:2001:6f8:105b:1122:21d:e0ff:fe39:f61b]) (using TLSv1 with cipher ECDHE-ECDSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: frogger) by bjornoya.do.blackshift.org (Postfix) with ESMTPSA id 6B9AF5E8AB; Tue, 4 Dec 2012 15:46:57 +0100 (CET) Message-ID: <50BE0CDB.5000704@pengutronix.de> Date: Tue, 04 Dec 2012 15:46:51 +0100 From: Marc Kleine-Budde Organization: Pengutronix e.K. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: linux-arm-kernel@lists.infradead.org Subject: linker problem with xip kernel and recent toolchains X-Enigmail-Version: 1.4.6 X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121204_094704_165678_7CEAF33E X-CRM114-Status: GOOD ( 16.67 ) 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 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "kernel@pengutronix.de" , Pawel Moll X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hello, we've just discovered a linker problem with newer toolchains, that support --build-id and xip kernels. The resulting vmlinux is about 13 MiB big, but the xipimage ~2GiB. A look at the vmlinux's objdump shows that the .notes section is around 2 GiB and it's placed by the linker script into the RAM. With the ROM starting at 0x0 this results into a ~2 GiB big image. > [16] .data PROGBITS 88008000 0a0000 012aa0 00 WA 0 0 256 > [17] .notes NOTE 8801aaa0 0b2aa0 000024 00 AX 0 0 4 > [18] .bss NOBITS 8801aae0 0b2ac4 005414 00 WA 0 0 32 After discarding the .notes section in the objcopy (see patch below) the resulting binary images has a proper size again. Marc index 1ec5f67..4448790 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -18,7 +18,7 @@ ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) LDFLAGS_vmlinux += --be8 endif -OBJCOPYFLAGS :=-O binary -R .comment -S +OBJCOPYFLAGS :=-O binary -R .comment -R .notes -S GZFLAGS :=-9 #KBUILD_CFLAGS +=-pipe