From patchwork Thu Aug 2 07:57:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 28731 Received: (qmail 123879 invoked by alias); 2 Aug 2018 07:58:53 -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 123334 invoked by uid 89); 2 Aug 2018 07:58:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: Ilya Leoshkevich To: libc-alpha@sourceware.org Cc: stli@linux.ibm.com, Ilya Leoshkevich Subject: [PATCH 05/12] S390: Do not clobber R0 in 32-bit _dl_runtime_resolve Date: Thu, 2 Aug 2018 09:57:28 +0200 In-Reply-To: <20180802075735.3457-1-iii@linux.ibm.com> References: <20180802075735.3457-1-iii@linux.ibm.com> x-cbid: 18080207-0020-0000-0000-000002AFD2A2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080207-0021-0000-0000-000020FBFD48 Message-Id: <20180802075735.3457-6-iii@linux.ibm.com> Preparation for the usage of R0 by __fentry__. * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve): Do not clobber R0. --- sysdeps/s390/s390-32/dl-trampoline.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h index fa83b79926..da50d9e9dc 100644 --- a/sysdeps/s390/s390-32/dl-trampoline.h +++ b/sysdeps/s390/s390-32/dl-trampoline.h @@ -26,8 +26,9 @@ * v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers * 24(r15), 28(r15) : PLT arguments PLT1, PLT2 * 96(r15) : additional stack parameters - * The normal clobber rules for function calls apply: - * r0 - r5 : call clobbered + * The slightly tightened normal clobber rules for function calls apply: + * r0 : call saved (for __fentry__) + * r1 - r5 : call clobbered * r6 - r13 : call saved * r14 : return address (call clobbered) * r15 : stack pointer (call saved) @@ -50,6 +51,7 @@ #define V29_OFF -144 #define V30_OFF -128 #define V31_OFF -112 +#define R0_OFF -76 #define PLT1_OFF -72 #define PLT2_OFF -68 #define R2_OFF -64 @@ -65,6 +67,8 @@ cfi_startproc .align 16 _dl_runtime_resolve: + st %r0,CFA_OFF+R0_OFF(%r15) + cfi_offset (r0, R0_OFF) stm %r2,%r5,CFA_OFF+R2_OFF(%r15) # save registers cfi_offset (r2, R2_OFF) cfi_offset (r3, R3_OFF) @@ -119,6 +123,7 @@ _dl_runtime_resolve: ld %f0,CFA_OFF+F0_OFF(%r15) ld %f2,CFA_OFF+F2_OFF(%r15) lm %r2,%r5,CFA_OFF+R2_OFF(%r15) + l %r0,CFA_OFF+R0_OFF(%r15) br %r1 1: .long _dl_fixup - 0b cfi_endproc @@ -131,6 +136,7 @@ _dl_runtime_resolve: #undef V29_OFF #undef V30_OFF #undef V31_OFF +#undef R0_OFF #undef PLT1_OFF #undef PLT2_OFF #undef R2_OFF