Message ID | 1445517279-4534-1-git-send-email-Peng.Fan@freescale.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8C35214131E for <incoming@patchwork.ozlabs.org>; Thu, 22 Oct 2015 23:35:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F268A746B; Thu, 22 Oct 2015 14:35:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G7cY2bsSOCaF; Thu, 22 Oct 2015 14:35:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF480A7452; Thu, 22 Oct 2015 14:35:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C9C5A7452 for <u-boot@lists.denx.de>; Thu, 22 Oct 2015 14:35:08 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WTprqjOLOre8 for <u-boot@lists.denx.de>; Thu, 22 Oct 2015 14:35:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0130.outbound.protection.outlook.com [207.46.100.130]) by theia.denx.de (Postfix) with ESMTPS id 130A9A7440 for <u-boot@lists.denx.de>; Thu, 22 Oct 2015 14:35:03 +0200 (CEST) Received: from CO2PR03CA0036.namprd03.prod.outlook.com (10.141.194.163) by CY1PR03MB1472.namprd03.prod.outlook.com (10.163.17.157) with Microsoft SMTP Server (TLS) id 15.1.306.13; Thu, 22 Oct 2015 12:35:01 +0000 Received: from BN1BFFO11FD018.protection.gbl (2a01:111:f400:7c10::1:140) by CO2PR03CA0036.outlook.office365.com (2a01:111:e400:1414::35) with Microsoft SMTP Server (TLS) id 15.1.286.15 via Frontend Transport; Thu, 22 Oct 2015 12:35:00 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=freescale.com; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD018.mail.protection.outlook.com (10.58.144.81) with Microsoft SMTP Server (TLS) id 15.1.306.13 via Frontend Transport; Thu, 22 Oct 2015 12:34:59 +0000 Received: from linux-jyl1.am.freescale.net ([10.192.185.91]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t9MCYe6M016434; Thu, 22 Oct 2015 05:34:55 -0700 From: Peng Fan <Peng.Fan@freescale.com> To: <u-boot@lists.denx.de> Date: Thu, 22 Oct 2015 20:34:37 +0800 Message-ID: <1445517279-4534-1-git-send-email-Peng.Fan@freescale.com> X-Mailer: git-send-email 1.8.4 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD018; 1:q+q7qkqU6JTd+94q8E6lnWtl7Y8hSItjc1CMhL4zZDG5cBWzZ591p7Ks4uhhwjfRwpENLlr8qiVjoxP3WMtcL0ld1FsucHnHAtiGRLHz3j86qrJx09OWDJeDTT48z4e982bTd92EoydOOYXoJgws/dSD4EWUWl1EPG0LZIC66WxnN/fR+FHqg7EY1LSxRHMKXs4MsevuuaibnYm4JpiPLgskgsK939H5A29DdGqzCSRslOJLA+vbWDeuC3hOUkx76MySfiI2cpjI1uyc726a6RFIv2JxZm9QxUcFFVym8tes/CPU37bl9lkLpMAodNHYrdFbZkvznNRAbjNifc/c0XCRjKSoj9Tm71Ukj5M6dahsinRQCoKsOOwCBtamXpfYkb9/a/IsjDTgl81G+wlBbg== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(19580405001)(86362001)(5003940100001)(110136002)(105606002)(5001960100002)(19580395003)(106466001)(5008740100001)(189998001)(97736004)(81156007)(50226001)(2351001)(229853001)(92566002)(87936001)(36756003)(50986999)(77096005)(5007970100001)(50466002)(85426001)(64706001)(5001920100001)(47776003)(48376002)(104016004)(46102003)(6806005)(15975445007); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR03MB1472; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1472; 2:VjPssxoXiDHfDZKCU1bbKMPB3y/7RVfW2WdpNbJ8ovvX515y9KGMFPJ4oPtDlHFCIgsbbYMqvFik7iVLyBlKs+6Mv0K/YIEUF2aBUS/lGPaM4tZoxEshTJ0fzZMMznl7ESNuYapUYe3KM3Ecr59+PVkvO38Zdo7GarYKjIICECc=; 3:MzKLaXf2uG1JkCAg64oAFA3BgJYxVt6pGTcBhQfJ2KktzUH8vkbsITERnqKu4vOPJeKfOoNBVPC0KcTQB2oPmtogS0C4tV46uxgZXvQV2kx7KA2AC2m/7n84C7v9L721C7r9erzGgrCi4jMnhBhurJGhwnIY1nhEbkEWzndHfN8AFvn+YrgDQAoAP8fgZHNwbkN3TvMXVD8d2LlHjU1EGlLw0zmn1KwSJUuP05A4Gsw=; 25:N9NUzw24B/DMUk14mWFmsFpQVMD4Uk9t1S3NTYXXNjbzpCM1TV7Y2ZGdnZuAdFmJwqTtP5Zi9u6tfPl+XR1yTvHiLz/VD6W+8qbEvHh5BlJa5QyPFrmJQAuu328K1jphhU7BGBA8YSNPRaiFf96LscDmxxMDf39mL6Zmf2pMvgIu9tTlT1EgECi3OVLQuuhXITZaJXFhvWN7sjxp/TY5SZTa/dWp9Nyo0iVpVtpzSIoY3og5NkMCHXrlZ3gHsI3z0pA+q9HM9ffRRLM2IxCPTQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1472; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1472; 20:JEu25UOXJtDFcg9jGW9T3ZdFfNdPV1aMqoWjRusYfx0EOn0ndauwst/S121byvFd9GxnuzPwayb6YoybYmZpaUeYfIcDyh3flPNqcSNLErnpx00hE7kKP2ARUvMS8P/rXZF7BdIhlS/1vGHCAOSkXUmJhEDzmIcUPzJ9kWWDya9r6GAUudfT+b+xsEIWbH9I7QNJkdCsb1TmimMGLCBZuZ1t4m6nhB08miRNr9j4tXGJLaBMbVMkWkQtL56Q/7xeQNDeengp4z+/GQLxroiwqpMRBRaNGak77L6RT7jMcF/DTdhVnpuBIlQuOeX24/g1svBMf7PuQDdnihYAk/OzA6wkdMbwKInjSvRhlzdAVN0=; 4:w6drf1kHFNRZUwMn62M7XCbRZgYf4mT1DYSMyV+/XnUQTjPOXOg5+sAoc4IYN9Cwxky9hWgYieOpD4OyzR817rmiQs60tmk+inK69sfGhVKWC6LQyLcDb58u7DtkK8x2HDt4oq1RHD0DzShX8Qi0MflmqA7chwxPCtn7TprtV8ecoHNmhOCmd2NR9UOta4rDo9KihwImkq9Tou3kunYhi8Nn+LC5FReFcVhbMFaikmbC+T8VbtJeT+jWQlnRgNqLSAjCh3o7r1DyAaCr4/cJ80tmWQ22O6HIn7F3ShxwtFwigXR7M/rHrA8abz0G73E9JDEzA3ZB0q+GhtK4T4Kev/tKzEebxpt30bCid99YE2rTekBg3WF9fmmWAOToTP7X X-Microsoft-Antispam-PRVS: <CY1PR03MB14725EB6EEB2EA2DC970636382270@CY1PR03MB1472.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(126837547833334)(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(102215026); SRVR:CY1PR03MB1472; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1472; X-Forefront-PRVS: 0737B96801 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB1472; 23:Y0SHddMBh0Wc2nCTUnEs+qVRHLpg4teqamzRetlEA?= =?us-ascii?Q?qqP0vY3pZ6V1XXOMp11CiNyiCqYqfd3MDAhSfjaEBszniMKDiSxsgwuGkLZ7?= =?us-ascii?Q?GhTtD/YI0aLt9RP9SzYFNMp73EHgLCxKOsceRHf/lfoCuAdS9eZMoTbe5Xid?= =?us-ascii?Q?3dUUqMvJ+jER5QNmrlnCucDNFivxQUArHa0bK1ZOhztbuiQtQFnRs6j2dUhN?= =?us-ascii?Q?djtfumU29hp0cP+Rmjveb3AEglWQg1ywfk3UkO77M5lL6Hq8Z0xsrvcc/djQ?= =?us-ascii?Q?m5VVTzR6ZKALFjY3hNiqqBmYR4uPFNg44AptSqhUFEVcDzmAPFH3mAV9ZEXU?= =?us-ascii?Q?MxKDwCaeuO3KzOqizMF8NBNyJd3uF0w+hL+uLq7aiX2344qtvT2b+ky7cOqh?= =?us-ascii?Q?uQC0Fjc5IwmHIcz9rjzwnEsEPzLmLrPvOVP+K/+4bwJN/+DzobCqtPp67UOn?= =?us-ascii?Q?LZPE6LuuYowOYVPypKhorU1QfQCsHLhzP/4aNkGwKfRvd4RnpmblZ1nCOjfY?= =?us-ascii?Q?1Wk5MZ/3LCLxO9aOEzmgmdQ1iZKt5r3xtYciJxZN8U/DDlvk764ia+FsJbqR?= =?us-ascii?Q?0oizvkD+3xJamMB3//Pstb9nytZBA6EY4NXzJJ0jpn6z+YVZ3/LLMUSuRPP/?= =?us-ascii?Q?LuKROzFJi7vM8N63+A7QDV4Geqocs2cH+JBwvt/v5iFxyLZUKIpsmaW5+kXI?= =?us-ascii?Q?xiNJvC1DxCGFdgxrY2FgB9kljRgA4iZezhIjsjMGgaS8qnB/av0lMW5AOH/B?= =?us-ascii?Q?nTYIT3NF5t6kXLo3/eNU0gVM2oUMcERTpo0yclCHQuxr7RarfLqTFQ9a7tCy?= =?us-ascii?Q?+I24u1D9PxldOBzlqhfOEfNgBKXb594nTxq9EXTO4/7w2jDp96cw0xnVCFLF?= =?us-ascii?Q?H6TxcmVBXGVG4C7yrSyoR521IWcU76xvhQnK/AZyGwz25FiAPsTbSkTIebhO?= =?us-ascii?Q?xzZO/d27Pldqig6EPjTsgLztjNRzzXZqC4CAYcRCCjsK4CgdVOlxZgBjWQWl?= =?us-ascii?Q?yRF2kKK5MDitQYBB+lw6iDag1rlPgPJIiPc/hxndnnA2g=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1472; 5:aU/tCG8KkR4ZpHlwcD4sHBfADcOiSUWnxyfnlzBqAk20o0RIILbvAZg/13wswThPTUOdEt1FGoHW0wGnl4xC5n1UVorQIZilksxRWTgKyQRs0+vF73+3vJq5fEvKQLZXxZY/sblUjs6+AuUXlkvlWw==; 24:sWdl4kWtIgjUIlQReLg4r5nowixOutnVAL+InM1TO0b3C6PSsUC0bjPEA+/b0HWLXnTEoZJzjXvvI9yH4pnaDOd7AYCOzpbCtu9Z61Br4fE=; 20:huXlVIdlqTrpbelU+u3ohI3i5NWyTIWd1gbn0VHyDh29aGFjxNTHercEtWO7/iLic4paOcik67llOORrvkTH2g== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2015 12:34:59.8098 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1472 Cc: Tom Rini <trini@konsulko.com>, Jan Kiszka <jan.kiszka@siemens.com>, Tom Warren <twarren@nvidia.com>, Ian Campbell <ijc@hellion.org.uk>, York Sun <yorksun@freescale.com> Subject: [U-Boot] [PATCH V3 1/3] arm: discard relocation entries for secure text X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <http://lists.denx.de/mailman/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <http://lists.denx.de/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 03cd9f6..d48a905 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -14,6 +14,23 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { + /* + * Discard the relocation entries for secure text. + * The secure code is bundled with u-boot image, so there will + * be relocations entries for the secure code, since we use + * "-mword-relocations" to compile and "-pie" to link into the + * final image. We do not need the relocation entries for secure + * code, because secure code will not be relocated, it only needs + * to be copied from loading address to CONFIG_ARMV7_SECURE_BASE, + * which is the linking and running address for secure code. + * If keep the relocation entries in .rel.dyn section, + * "relocation offset + linking address" may locates into an + * address that is reserved by SoC, then will trigger data abort. + * + * The reason that move .rel._secure at the beginning, is to + * avoid hole in the final image. + */ + /DISCARD/ : { *(.rel._secure*) } . = 0x00000000; . = ALIGN(4);
The code such as PSCI in section named secure is bundled with u-boot image, and when bootm, the code will be copied to their runtime address same to compliation/linking address - CONFIG_ARMV7_SECURE_BASE. When compile the PSCI code and link it into the u-boot image, there will be relocation entries in .rel.dyn section for PSCI. Actually, we do not needs these relocation entries. If still keep the relocation entries in .rel.dyn section, r0 at line 103 and 106 in arch/arm/lib/relocate.S may be an invalid address which may not support read/write for one SoC. 102 /* relative fix: increase location by offset */ 103 add r0, r0, r4 104 ldr r1, [r0] 105 add r1, r1, r4 106 str r1, [r0] So discard them to avoid touching the relocation entry in arch/arm/lib/relocate.S. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Tom Warren <twarren@nvidia.com> Cc: York Sun <yorksun@freescale.com> Cc: Hans De Goede <hdegoede@redhat.com> Cc: Ian Campbell <ijc@hellion.org.uk> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@konsulko.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Stefano Babic <sbabic@denx.de> --- V2 thread: http://lists.denx.de/pipermail/u-boot/2015-October/230755.html Changes v3: Move the relocation entries to the very begining and discard them. V1 thread: http://lists.denx.de/pipermail/u-boot/2015-October/229426.html Changes V2: Refine commit msg. Discard the relocation entry section for secure text. arch/arm/cpu/u-boot.lds | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)