From patchwork Tue Jun 28 16:39:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 71126 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1692948qgy; Tue, 28 Jun 2016 09:41:24 -0700 (PDT) X-Received: by 10.66.150.105 with SMTP id uh9mr3404788pab.73.1467132084515; Tue, 28 Jun 2016 09:41:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si7658396pfp.124.2016.06.28.09.41.24; Tue, 28 Jun 2016 09:41:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbcF1Qku (ORCPT + 30 others); Tue, 28 Jun 2016 12:40:50 -0400 Received: from mail-bn1on0075.outbound.protection.outlook.com ([157.56.110.75]:10426 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752514AbcF1Qkr (ORCPT ); Tue, 28 Jun 2016 12:40:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LoyvQWaK0wCNXdNpobJB58X3Urnfwoly4oDbhnxLNuc=; b=CpwNrq29AUhE2Hp6fl5xkVlgWlBjeywEROlVa3SyoUGvk8hzhEzpLSHVbuIZWx4lpbuCqWcwjrEHnYQqUqpQMVDYpXnnrB5CiD8T/h0ZyjV0vF+dLEjhFpuI779eNxgVGh+7lk3smEdjH0gOYLq89ItVDyLQj+QGdpf+PQvdhaI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by SN1PR07MB2253.namprd07.prod.outlook.com (10.164.47.147) with Microsoft SMTP Server (TLS) id 15.1.528.16; Tue, 28 Jun 2016 16:40:44 +0000 From: Yury Norov To: , CC: , , , , , , , , , , , , , , , , Andrew Pinski , Yury Norov Subject: [PATCH 05/23] [AARCH64] Use PTR_REG in crti.S. Date: Tue, 28 Jun 2016 19:39:20 +0300 Message-ID: <1467131978-669-6-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467131978-669-1-git-send-email-ynorov@caviumnetworks.com> References: <1467131978-669-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM5PR0901CA0009.eurprd09.prod.outlook.com (10.164.186.147) To SN1PR07MB2253.namprd07.prod.outlook.com (10.164.47.147) X-MS-Office365-Filtering-Correlation-Id: 4dc60d38-4a3b-4a21-9d18-08d39f72f349 X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 2:MBBdsAchtvbrFdSXBZ//VoVwngG9YQtd/unJl4rI2JBMftoQs6v/F++FnZWU8bOjPEYoFGeq6q1QtrPTNm/YX75yqKCFwyoJr9t2op2R/+Vg+YP8eM2xhCWfbW18YusLl0lRXnLUhtuFMjX/SXMSjOGr3Xm5adOC5vYVZT25diLZzo3zqlPr7gUZkIex+AuL; 3:L52ki+DKVYhYfcDYfH9/Io4YAlWbHb/NMZsFqH6UhNMQ4eVsG7+pFU/KNt3VSZxIYIVFyue3j44v8Ruk2856zzYHjSaCikPrCHTi7u3bZwwuN4n6SkVRXwI2NoY77Fob X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07M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KlxkffpPeSInf767M8g==; 20:srAyvBYv9CswQfH3v/AnFmhttFLQ9LNqP4OlgxLYSvZZhVYg/yfv+k1Wog6u9RPzkzyaGSiqrMPFjwrtKHFa7z2GE0obSGWD1v+0j4TB6mt2BTQ9hmOW3t/M4zl73uKje5OQIv3nHA8QPQHYktdz4lqChz+SS2RTxn6Rkfu1zlbigeDD9pwGB8Bf5czyCw+Xj2qRng4n7I9eEXJz5Bh5sh9rozqu5X145ysujIBU5WlqqhyqNNyoNJXZgVEWS9HZhBgRXQ6Ufi72T9k1kLiQEdNI1jR64HEMjduRVo8sfxVpdFia/POvJgZB7AbhdMcO9+gtCkIM4/IZRKYAmrDo3DRfP45aT/MXUAMTDarPM3QjudOXG9lCcU3XtA0phwd+cRqVb+KHoF3colGe/4Ke3aHUTQ2rcYbRqAvLXjL/QYcMRanj3C6lapuG6gzl7Vp77XOrThsqFWMB0PgS6gCvbRiCzcOhPPQrR/W1VWMUiod/f1Y6FiYGv3LUwISrcDYaX6K9Ge6pdXCOIJk6sy1PR+nqPosf2EQCqztcHSGYng+nspmu2GFOvKnWwbd4+0TTabXf18UhaJqe9N/QNoz/qx01A3OwPKD8LP3WFdopXbU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:SN1PR07MB2253; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2253; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 4:BpDRkjibVjO1NNNgxxmNQYGM+mBLJKqUB8J++dLnlJH7A67RU8NJTiRm3BhJ72TkI2hUpdp5lloAaU14uOPYU2TFd7+w5acBcxe1k06UPxq0WDMYuBla7972kNlDxVPZJeQfwydCVOodBzPlWoPkvevv88avVvmGeKGf6lAsS/gDlJnRkw10mf6iuMjKsnQHs9t+FFV/TsuSGb3Ots/ruerIb7xrd9OZlUThoq/BQqxKFnBSq3Di4kyC4gF2Cv/lo1i038FAmHy8SEl3n6qolpvrasGXAKcVOw/MF1AK4ISqfmwlfd8p3Op5navjkJRwgS2mhGQ1UkAKxipxO8PgoWZH1GDtMTKZjJ1yIqrUFYIpzMr+M6+9V6Ja8dpnOW6j X-Forefront-PRVS: 0987ACA2E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(57704003)(92566002)(229853001)(3846002)(76506005)(6116002)(4326007)(50226002)(106356001)(4001430100002)(105586002)(77096005)(19580405001)(47776003)(2906002)(189998001)(7846002)(33646002)(50466002)(48376002)(66066001)(81156014)(8676002)(101416001)(305945005)(586003)(5003940100001)(107886002)(19580395003)(76176999)(68736007)(2950100001)(97736004)(81166006)(50986999)(7736002)(5001770100001)(42186005)(36756003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2253; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2253; 23:MkuuWMPNlIzhnrGXokkMFO6HIsaLnbnAkA7SaY76K?= =?us-ascii?Q?gdyKN86BBGG2PuYjIPjVyPsEWNG2r8+Z7LQzMyBnI1aE9OhPCkbPr7g0Zxlh?= =?us-ascii?Q?bwiXjXy7Z45JiXpXGTPHcGx44E9eOCYTGoXL1eoHn3MQKto5XYoQMPatAkWC?= =?us-ascii?Q?oeOWkTdFtQDaBiq/Aeiu6i9aVfZvLnmKtW7eYCX4IHjAWPzI2/G/Bmm801Mc?= =?us-ascii?Q?3k1AjEPJZbotC4pZeWnOj9ezLTOX/4W0/H9Wr/yTQST/JA3n+s+iOIrX0GGl?= =?us-ascii?Q?YOcfPQhfwmarr3Dtj4Q42XWCSRFCQWtDA8FLtllv6kWTpG+woZuiT9TwT6Ox?= =?us-ascii?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ange-Diagnostics: 1; SN1PR07MB2253; 6:ypcsZ++s+Ur96P2QyDa4m3r7+y+AgQ5nzNobkwC4lRFCmsVi1myAHvcTdvmlJRChaP5G9+yX7cMIfkAejgFxytBe/SB+raqJPuN1c9Ds04FJJY6kHLRwmZApJSOUe5/+sgStSa9YLYnGhnD6J0yNfx0rteb3lezndmj/l4Jbkj1j+u7WGLujqCZsLQ0oIr/GfGjcpY/ZG2oz4rYBP8dHdXNdvRi0nFzZhMmITRyyabMIZK9Ol75IGFlYURvpj310oprs+tDHm9f9UDxPHLx5OSz90QtTIcp7kqlwk6WI5lQ=; 5:j3spvrogSiO9cVof8fSGne7jKg8g31zzBkJYVrSDbZ9vlSSewxshF5HsOEex7INkMERYY3PbfCz+P3uvYDFAvPAF1y0RG49FPWVkGzgj0IFXn3D7lfifEcd9VeC4zMXuFF0E5PAlJi4Vw9AdDAK4iw==; 24:PPkXljZF7ToUA2qMlC3+FRklFMPyM9E4NIC+5Ro58RWwTypAoMmV6pfQQBFYrlL+XzmoIFenuYo4PO+RG51U3SJflvuudIoa6QzEAcsmjBI=; 7:lgsw09ydQ1IOlqd+0RDcsJM2XFF2LQsFaWJR6GTvZ6LIIE0G5cYRhyUskXzjKl1DIxFgh2PXSjnX4eSuX6wD7/Zl0vztACv88Wp1dgdTZIOWm8418ZVy8/cN69d2IS85DvBC76lafl+ATnJ23NWLDQe81z+UL3KxqjCDTGggXYy/gNz6HlqaRoHRcUL1O4ArfR4SlGhuB8a0SBh9Hp8e0BUmUNPVUmyqFt2V2LPhfu2Y7hhnr/2lBb6bBqYfnX6B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 16:40:44.2234 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2253 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Pinski call_weak_fn loads from a pointer, so use PTR_REG so the load is 32bits for ILP32. * sysdeps/aarch64/crti.S: Include sysdep.h (call_weak_fn): Use PTR_REG when loading from PREINIT_FUNCTION. AARCH64: Make RTLD_START paramatizable Make RTLD_START paramatizable for ILP32 and LP64 usage and provides common code between ILP32. * sysdeps/aarch64/dl-machine.h (RTLD_START): Rename to ... (RTLD_START_1): This and add PTR, PTR_SIZE_LOG, and PTR_SP arguments. (RTLD_START): New macro which uses RTLD_START_1. Signed-off-by: Yury Norov --- sysdeps/aarch64/crti.S | 3 +- sysdeps/aarch64/dl-machine.h | 128 ++++++++++++++++++++++--------------------- 2 files changed, 69 insertions(+), 62 deletions(-) -- 2.7.4 diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S index 53ccb42..6e149b5 100644 --- a/sysdeps/aarch64/crti.S +++ b/sysdeps/aarch64/crti.S @@ -39,6 +39,7 @@ they can be called as functions. The symbols _init and _fini are magic and cause the linker to emit DT_INIT and DT_FINI. */ +#include #include #ifndef PREINIT_FUNCTION @@ -60,7 +61,7 @@ .type call_weak_fn, %function call_weak_fn: adrp x0, :got:PREINIT_FUNCTION - ldr x0, [x0, #:got_lo12:PREINIT_FUNCTION] + ldr PTR_REG(0), [x0, #:got_lo12:PREINIT_FUNCTION] cbz x0, 1f b PREINIT_FUNCTION 1: diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index a16cb11..ec41bfe 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -126,68 +126,74 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) /* Initial entry point for the dynamic linker. The C function _dl_start is the real entry point, its return value is the user program's entry point */ +#ifdef __LP64__ +# define RTLD_START RTLD_START_1 ("x", "3", "sp") +#else +# define RTLD_START RTLD_START_1 ("w", "2", "wsp") +#endif + -#define RTLD_START asm ("\ -.text \n\ -.globl _start \n\ -.type _start, %function \n\ -.globl _dl_start_user \n\ -.type _dl_start_user, %function \n\ -_start: \n\ - mov x0, sp \n\ - bl _dl_start \n\ - // returns user entry point in x0 \n\ - mov x21, x0 \n\ -_dl_start_user: \n\ - // get the original arg count \n\ - ldr x1, [sp] \n\ - // get the argv address \n\ - add x2, sp, #8 \n\ - // get _dl_skip_args to see if we were \n\ - // invoked as an executable \n\ - adrp x4, _dl_skip_args \n\ - ldr w4, [x4, #:lo12:_dl_skip_args] \n\ - // do we need to adjust argc/argv \n\ - cmp w4, 0 \n\ - beq .L_done_stack_adjust \n\ - // subtract _dl_skip_args from original arg count \n\ - sub x1, x1, x4 \n\ - // store adjusted argc back to stack \n\ - str x1, [sp] \n\ - // find the first unskipped argument \n\ - mov x3, x2 \n\ - add x4, x2, x4, lsl #3 \n\ - // shuffle argv down \n\ -1: ldr x5, [x4], #8 \n\ - str x5, [x3], #8 \n\ - cmp x5, #0 \n\ - bne 1b \n\ - // shuffle envp down \n\ -1: ldr x5, [x4], #8 \n\ - str x5, [x3], #8 \n\ - cmp x5, #0 \n\ - bne 1b \n\ - // shuffle auxv down \n\ -1: ldp x0, x5, [x4, #16]! \n\ - stp x0, x5, [x3], #16 \n\ - cmp x0, #0 \n\ - bne 1b \n\ - // Update _dl_argv \n\ - adrp x3, _dl_argv \n\ - str x2, [x3, #:lo12:_dl_argv] \n\ -.L_done_stack_adjust: \n\ - // compute envp \n\ - add x3, x2, x1, lsl #3 \n\ - add x3, x3, #8 \n\ - adrp x16, _rtld_local \n\ - add x16, x16, #:lo12:_rtld_local \n\ - ldr x0, [x16] \n\ - bl _dl_init \n\ - // load the finalizer function \n\ - adrp x0, _dl_fini \n\ - add x0, x0, #:lo12:_dl_fini \n\ - // jump to the user_s entry point \n\ - br x21 \n\ +#define RTLD_START_1(PTR, PTR_SIZE_LOG, PTR_SP) asm ("\ +.text \n\ +.globl _start \n\ +.type _start, %function \n\ +.globl _dl_start_user \n\ +.type _dl_start_user, %function \n\ +_start: \n\ + mov " PTR "0, " PTR_SP " \n\ + bl _dl_start \n\ + // returns user entry point in x0 \n\ + mov x21, x0 \n\ +_dl_start_user: \n\ + // get the original arg count \n\ + ldr " PTR "1, [sp] \n\ + // get the argv address \n\ + add " PTR "2, " PTR_SP ", #(1<<" PTR_SIZE_LOG ") \n\ + // get _dl_skip_args to see if we were \n\ + // invoked as an executable \n\ + adrp x4, _dl_skip_args \n\ + ldr w4, [x4, #:lo12:_dl_skip_args] \n\ + // do we need to adjust argc/argv \n\ + cmp w4, 0 \n\ + beq .L_done_stack_adjust \n\ + // subtract _dl_skip_args from original arg count \n\ + sub " PTR "1, " PTR "1, " PTR "4 \n\ + // store adjusted argc back to stack \n\ + str " PTR "1, [sp] \n\ + // find the first unskipped argument \n\ + mov " PTR "3, " PTR "2 \n\ + add " PTR "4, " PTR "2, " PTR "4, lsl #" PTR_SIZE_LOG " \n\ + // shuffle argv down \n\ +1: ldr " PTR "5, [x4], #(1<<" PTR_SIZE_LOG ") \n\ + str " PTR "5, [x3], #(1<<" PTR_SIZE_LOG ") \n\ + cmp " PTR "5, #0 \n\ + bne 1b \n\ + // shuffle envp down \n\ +1: ldr " PTR "5, [x4], #(1<<" PTR_SIZE_LOG ") \n\ + str " PTR "5, [x3], #(1<<" PTR_SIZE_LOG ") \n\ + cmp " PTR "5, #0 \n\ + bne 1b \n\ + // shuffle auxv down \n\ +1: ldp " PTR "0, " PTR "5, [x4, #(2<<" PTR_SIZE_LOG ")]! \n\ + stp " PTR "0, " PTR "5, [x3], #(2<<" PTR_SIZE_LOG ") \n\ + cmp " PTR "0, #0 \n\ + bne 1b \n\ + // Update _dl_argv \n\ + adrp x3, _dl_argv \n\ + str " PTR "2, [x3, #:lo12:_dl_argv] \n\ +.L_done_stack_adjust: \n\ + // compute envp \n\ + add " PTR "3, " PTR "2, " PTR "1, lsl #" PTR_SIZE_LOG " \n\ + add " PTR "3, " PTR "3, #(1<<" PTR_SIZE_LOG ") \n\ + adrp x16, _rtld_local \n\ + add " PTR "16, " PTR "16, #:lo12:_rtld_local \n\ + ldr " PTR "0, [x16] \n\ + bl _dl_init \n\ + // load the finalizer function \n\ + adrp x0, _dl_fini \n\ + add " PTR "0, " PTR "0, #:lo12:_dl_fini \n\ + // jump to the user_s entry point \n\ + br x21 \n\ "); #define elf_machine_type_class(type) \