From patchwork Tue Nov 17 16:45:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Brandt X-Patchwork-Id: 7639591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9614ABF90C for ; Tue, 17 Nov 2015 16:48:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A92BA2041B for ; Tue, 17 Nov 2015 16:48:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF0FD20452 for ; Tue, 17 Nov 2015 16:48:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyjOj-0000Gs-Um; Tue, 17 Nov 2015 16:46:25 +0000 Received: from relmlor4.renesas.com ([210.160.252.174] helo=relmlie3.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyjOg-000087-4o for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 16:46:23 +0000 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 18 Nov 2015 01:46:00 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 8B6824358E; Wed, 18 Nov 2015 01:46:00 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 7345F480A4; Wed, 18 Nov 2015 01:46:00 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 6C58C480A3; Wed, 18 Nov 2015 01:46:00 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id BAD08487; Wed, 18 Nov 2015 01:46:00 +0900 X-IronPort-AV: E=Sophos;i="5.20,308,1444662000"; d="scan'208";a="198759544" Received: from mail-hk2apc01lp0207.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.207]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 18 Nov 2015 01:45:59 +0900 Received: from HK2PR06MB0561.apcprd06.prod.outlook.com (10.161.183.154) by HK2PR06MB0563.apcprd06.prod.outlook.com (10.161.183.156) with Microsoft SMTP Server (TLS) id 15.1.325.17; Tue, 17 Nov 2015 16:45:58 +0000 Received: from HK2PR06MB0561.apcprd06.prod.outlook.com ([10.161.183.154]) by HK2PR06MB0561.apcprd06.prod.outlook.com ([10.161.183.154]) with mapi id 15.01.0325.003; Tue, 17 Nov 2015 16:45:59 +0000 From: Chris Brandt To: Nicolas Pitre Subject: RE: [PATCH v3] ARM: xip: Use correct symbol for end of ROM marker Thread-Topic: [PATCH v3] ARM: xip: Use correct symbol for end of ROM marker Thread-Index: AQHRIK01s8/pF44pj067et4P7aZ/JJ6fHTRQgAASJACAATx1sA== Date: Tue, 17 Nov 2015 16:45:58 +0000 Message-ID: References: <1447362108-4333-1-git-send-email-chris.brandt@renesas.com> <1447697140-4099-1-git-send-email-chris.brandt@renesas.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chris.Brandt@renesas.com; x-originating-ip: [4.59.13.106] x-microsoft-exchange-diagnostics: 1; HK2PR06MB0563; 5:Y11q255N492QRGz10geI5jrKWGv2db1XzOAHtzbmTB4XR40qri5y8KjHZYUt0IiLlPgIUpnDhfQXZUyr3OgDErRDEXmpK0MTxL5BtlDkkXV+dEUKIZ9g1tuBCPUACQoSdJJnQahPQc9jrzHgGJrvRw==; 24:iZ0yVEU5m8nJzKep+AxCdOBDQxuAqlERNs5K2+IjQjazv0NOBRG0oLcmikAbYd4OIn/At58x77AxUm06pFZRBfgiwbbC/M95Aow5HVwitUc=; 20:h4aoz3UnYx3f8JGB8EUNgict3pEYA6yMela83Kem+MQygEl8qTUYNyiSCy92MFzisGwQkn1cosjJISzsyEP2WEhSajMA0RB4A/W5EggrpVJ5rNLsjpe7DVx26sfsyDcPFYd+SmjhUTA56J9eEw1NJNtZzwkerQ3zYFPvqqa1APk= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0563; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:HK2PR06MB0563; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0563; x-forefront-prvs: 07630F72AD x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(76104003)(199003)(92566002)(2900100001)(2950100001)(10400500002)(77096005)(102836002)(5003600100002)(189998001)(81156007)(66066001)(110136002)(76576001)(97736004)(5007970100001)(40100003)(5008740100001)(19580395003)(122556002)(93886004)(86362001)(5001960100002)(74316001)(87936001)(33656002)(5004730100002)(54356999)(76176999)(106116001)(586003)(50986999)(106356001)(5002640100001)(105586002)(101416001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0563; H:HK2PR06MB0561.apcprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Nov 2015 16:45:58.1152 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0563 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_084622_411981_ECCA7AA3 X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.2 (---) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux@arm.linux.org.uk" , "linux-arm-kernel@lists.infradead.org" , "linux-sh@vger.kernel.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > The old method with conditional placement in the linker script is > broken beyond repair. There is simply way too much stuff these days > to do this sanely. I think the only way to fix it properly is to > have a separate linker script for XIP usage with proper (and obvious) > section placement. Step 1: Change the Makefiles to select an alternative linker script. What do you think about doing the following? Chris diff --git a/Makefile b/Makefile index fd46821..956ad21 100644 --- a/Makefile +++ b/Makefile @@ -898,7 +898,11 @@ libs-y := $(libs-y1) $(libs-y2) # Externally visible symbols (used by link-vmlinux.sh) export KBUILD_VMLINUX_INIT := $(head-y) $(init-y) export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) +ifdef CONFIG_XIP_KERNEL +export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux-xip.lds +else export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds +endif export LDFLAGS_vmlinux # used by scripts/pacmage/Makefile export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools virt) diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index af9e59b..d97fc2e 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -3,6 +3,7 @@ # CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) +CPPFLAGS_vmlinux-xip.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) ifdef CONFIG_FUNCTION_TRACER @@ -92,4 +93,8 @@ obj-y += psci-call.o obj-$(CONFIG_SMP) += psci_smp.o endif +ifdef CONFIG_XIP_KERNEL +extra-y := $(head-y) vmlinux-xip.lds +else extra-y := $(head-y) vmlinux.lds +endif