From patchwork Wed Aug 1 22:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 143317 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1414984ljj; Wed, 1 Aug 2018 15:24:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6r3RxF9lCboxobee6acDJZR5Fbgr+hWCcvroCyIQRXwluMfUol1vNsVTQEswgFLMh5qsY X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr138158plv.193.1533162280873; Wed, 01 Aug 2018 15:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533162280; cv=none; d=google.com; s=arc-20160816; b=zPpw8i+JPaw6EZOVat6OFzqZ74IA3iHuHHPfjF9sgetdBlKNpPIpORTcrA5ToJ0lhi Pl6lB3+cjxQ1kX/xJubvcaU3wR1DJhKHmXP+XqDYPaKUtG9bcuu8mhlxvqivcqDyi1Vv c98gF92dzbfjTlhvVbYVKlH/R/ZbpvEQveheCfVCl45U5lFwlgUzMjN7ALVrCVJkMVTe ClneMOacKNKY3fLL0Va1ztIiVoYPYGgGSu/I9VB3AjILa1VAKA68Tmf1cB8FJpAwPm3G BYxQQabrtY01qUvokkeLmrPmko3DrOhYOSO9TNnLhJRt4/JYJOXuFJure+kgUAPFvGpr kASA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :arc-authentication-results; bh=sOhRp65/pGulKyAWQDLjGPI89+CTFVdgL3WNY/sc4X4=; b=ZPYRwaxGl21wHZn1bja8PbSN1qr8O+Lr4T6eaRN3c7a9Fdkga43NMIg3N6RAudh7TU q3F6gTUA9jzSYPozKYZUEECa/u/Yi5d/vP9wZyMeX4nLWrzAdNtsDDDldjRO+uAcNuhj Sit9l/pD8F+lMQWMAnFav/XROMliHTcOBjLPCAjnYWflFPir5hNTrq0lo7vYQBbdkqyr 3oe1/+fqHT9zY/li3GTc7X9EwrHyZHzbqA0GIlKQjfVD4UgsV+IkIQeTdc1l12GYgNWX eREw3HM1kunGiUqOyNYwo5yweZwmfURRWpRB+tII29QuS8mA3UbRAY1L0zCUASIep7M0 EH1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AUW5hRh8; spf=pass (google.com: domain of libc-alpha-return-94987-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94987-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id d66-v6si151499pfa.186.2018.08.01.15.24.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 15:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-94987-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AUW5hRh8; spf=pass (google.com: domain of libc-alpha-return-94987-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94987-patch=linaro.org@sourceware.org" Received: (qmail 24395 invoked by alias); 1 Aug 2018 22:24:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24267 invoked by uid 89); 1 Aug 2018 22:23:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=PROF, Jump X-HELO: mail-ua0-f173.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sOhRp65/pGulKyAWQDLjGPI89+CTFVdgL3WNY/sc4X4=; b=AUW5hRh81h5n8nP4IbeGivMSIWMtM9SKr4mkjg9yZYmN8atGBDfDCYzvba79PiRxUo krJ33cOIFsOQnfRi/n3vUiy77hTOSXwQwNN05uX/qgQC1EomLcLNFcG1awAkNMBb4qS3 /kysswfSrYKnoc1r3+bk55t4yjg2IQBWN8AjZiQLPU7vCnMF94tGACb59FMNxRYtWXMO q+EaKhR1LTY4IDUnjlvvThm0GwJLgads7XwOmBN6N3cCrp+VEsiTqzQhcWplDR71Ne13 NgVqK+kWVa09qSO/aDAm/snG4L0EAcW8CUzZNOswknoCYAeU1BHZzDWuZHa1I2NEoHo4 Tynw== Return-Path: Sender: Richard Henderson From: rth@twiddle.net To: libc-alpha@sourceware.org Cc: marcus.shawcroft@linaro.org, szabolcs.nagy@arm.com, Richard Henderson Subject: [PATCH 1/3] aarch64: Clean up _dl_runtime_resolve Date: Wed, 1 Aug 2018 18:23:45 -0400 Message-Id: <20180801222347.18903-2-rth@twiddle.net> In-Reply-To: <20180801222347.18903-1-rth@twiddle.net> References: <20180801222347.18903-1-rth@twiddle.net> From: Richard Henderson * sysdeps/aarch64/dl-trampoline.S (_dl_runtime_resolve): Do not record unwind info for arguments; this is unneeded; do not save x9 just to have a register to pair with x8; properly include the 16 bytes of PLT stack into the unwind; create a frame pointer with the spare stack slot; rearrange the exit to only adjust the stack once. --- sysdeps/aarch64/dl-trampoline.S | 50 +++++++++------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) -- 2.17.1 diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S index a86d0722d4..e8e2af485a 100644 --- a/sysdeps/aarch64/dl-trampoline.S +++ b/sysdeps/aarch64/dl-trampoline.S @@ -32,7 +32,6 @@ .text .globl _dl_runtime_resolve .type _dl_runtime_resolve, #function - cfi_startproc .align 2 _dl_runtime_resolve: /* AArch64 we get called with: @@ -41,46 +40,24 @@ _dl_runtime_resolve: [sp, #8] lr [sp, #0] &PLTGOT[n] */ - + cfi_startproc + cfi_adjust_cfa_offset(16) /* Incorporate PLT */ cfi_rel_offset (lr, 8) /* Save arguments. */ - stp x8, x9, [sp, #-(80+8*16)]! + stp x29, x8, [sp, #-(80+8*16)]! cfi_adjust_cfa_offset (80+8*16) - cfi_rel_offset (x8, 0) - cfi_rel_offset (x9, 8) + cfi_rel_offset (x29, 0) + mov x29, sp stp x6, x7, [sp, #16] - cfi_rel_offset (x6, 16) - cfi_rel_offset (x7, 24) - stp x4, x5, [sp, #32] - cfi_rel_offset (x4, 32) - cfi_rel_offset (x5, 40) - stp x2, x3, [sp, #48] - cfi_rel_offset (x2, 48) - cfi_rel_offset (x3, 56) - stp x0, x1, [sp, #64] - cfi_rel_offset (x0, 64) - cfi_rel_offset (x1, 72) - stp q0, q1, [sp, #(80+0*16)] - cfi_rel_offset (q0, 80+0*16) - cfi_rel_offset (q1, 80+1*16) - stp q2, q3, [sp, #(80+2*16)] - cfi_rel_offset (q0, 80+2*16) - cfi_rel_offset (q1, 80+3*16) - stp q4, q5, [sp, #(80+4*16)] - cfi_rel_offset (q0, 80+4*16) - cfi_rel_offset (q1, 80+5*16) - stp q6, q7, [sp, #(80+6*16)] - cfi_rel_offset (q0, 80+6*16) - cfi_rel_offset (q1, 80+7*16) /* Get pointer to linker struct. */ ldr PTR_REG (0), [ip0, #-PTR_SIZE] @@ -101,25 +78,26 @@ _dl_runtime_resolve: mov ip0, x0 /* Get arguments and return address back. */ - ldp q0, q1, [sp, #(80+0*16)] - ldp q2, q3, [sp, #(80+2*16)] - ldp q4, q5, [sp, #(80+4*16)] + ldr lr, [sp, #80+8*16+8] ldp q6, q7, [sp, #(80+6*16)] + ldp q4, q5, [sp, #(80+4*16)] + ldp q2, q3, [sp, #(80+2*16)] + ldp q0, q1, [sp, #(80+0*16)] ldp x0, x1, [sp, #64] ldp x2, x3, [sp, #48] ldp x4, x5, [sp, #32] ldp x6, x7, [sp, #16] - ldp x8, x9, [sp], #(80+8*16) - cfi_adjust_cfa_offset (-(80+8*16)) - - ldp ip1, lr, [sp], #16 - cfi_adjust_cfa_offset (-16) + ldp x29, x8, [sp], 80+8*16+16 + cfi_adjust_cfa_offset (-(80+8*16+16)) + cfi_restore (lr) + cfi_restore (x29) /* Jump to the newly found address. */ br ip0 cfi_endproc .size _dl_runtime_resolve, .-_dl_runtime_resolve + #ifndef PROF .globl _dl_runtime_profile .type _dl_runtime_profile, #function