From patchwork Thu Jun 25 23:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 39804 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 552793870841; Thu, 25 Jun 2020 23:02:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 552793870841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1593126167; bh=spYds9UbC+WoqvIB6gTBe+lRUAq8ANxnxISxRZQpDcc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=p2Sy8uNMqI072yOz+CzRQrsdod6GFz0wx0jJt/9uIeIEsKO3pdF/+0omo8pEXR8QD +vA/uVYPfkbva0hH+KL6UU8PLbbf/JdXjxaWIbvLD2AzOQFpIlJwMY3b5r923M950X GP6fA3c3BJkawcQM50pW0vHPKQNBY2i/k+MWjCEM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B2F1B386F432 for ; Thu, 25 Jun 2020 23:02:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B2F1B386F432 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05PN1p0o087611 for ; Thu, 25 Jun 2020 19:02:44 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 31ux08djwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 25 Jun 2020 19:02:43 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05PMsf95014184 for ; Thu, 25 Jun 2020 23:02:42 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 31uus3ykb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 25 Jun 2020 23:02:42 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05PN2gR457999628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Jun 2020 23:02:42 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC514BE05B for ; Thu, 25 Jun 2020 23:02:41 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C8DDBE051 for ; Thu, 25 Jun 2020 23:02:41 +0000 (GMT) Received: from linux.ibm.com (unknown [9.65.204.52]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP for ; Thu, 25 Jun 2020 23:02:40 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] powerpc64: Fix calls when r2 is not used [BZ #26173] Date: Thu, 25 Jun 2020 20:02:24 -0300 Message-Id: <20200625230224.301671-1-tuliom@linux.ibm.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-25_19:2020-06-25, 2020-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 mlxscore=0 impostorscore=0 cotscore=-2147483648 mlxlogscore=953 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250133 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tulio Magno Quites Machado Filho via Libc-alpha From: Tulio Magno Quites Machado Filho Reply-To: Tulio Magno Quites Machado Filho Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Teach the linker that __mcount_internal, __sigjmp_save_symbol, __syscall_error and __GI_exit do not use r2, so that it does not need to recover r2 after the call. --- sysdeps/powerpc/powerpc64/ppc-mcount.S | 2 +- sysdeps/powerpc/powerpc64/setjmp-common.S | 2 +- sysdeps/powerpc/powerpc64/sysdep.h | 2 +- sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/ppc-mcount.S b/sysdeps/powerpc/powerpc64/ppc-mcount.S index f7e9836cae..7b2b3ab908 100644 --- a/sysdeps/powerpc/powerpc64/ppc-mcount.S +++ b/sysdeps/powerpc/powerpc64/ppc-mcount.S @@ -29,7 +29,7 @@ ENTRY(_mcount) cfi_adjust_cfa_offset (FRAME_MIN_SIZE) cfi_offset (lr, FRAME_LR_SAVE) ld r3, FRAME_LR_SAVE(r11) - bl JUMPTARGET(__mcount_internal) + bl JUMPTARGET(__mcount_internal@notoc) #ifndef SHARED nop #endif diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S index eb37000980..44cc43937e 100644 --- a/sysdeps/powerpc/powerpc64/setjmp-common.S +++ b/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -217,7 +217,7 @@ L(no_vmx): li r3,0 blr #elif defined SHARED - b JUMPTARGET (__sigjmp_save_symbol) + b JUMPTARGET (__sigjmp_save_symbol@notoc) #else mflr r0 std r0,FRAME_LR_SAVE(r1) diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h index d6616ac905..fbddeb492e 100644 --- a/sysdeps/powerpc/powerpc64/sysdep.h +++ b/sysdeps/powerpc/powerpc64/sysdep.h @@ -278,7 +278,7 @@ LT_LABELSUFFIX(name,_name_end): ; \ #ifdef SHARED #define TAIL_CALL_SYSCALL_ERROR \ - b JUMPTARGET(__syscall_error) + b JUMPTARGET(__syscall_error@notoc) #else /* Static version might be linked into a large app with a toc exceeding 64k. We can't put a toc adjusting stub on a plain branch, so can't diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S index e4d4575d68..fd22f8f7ae 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S @@ -160,7 +160,7 @@ L(exitcode): li r3,-1 L(do_exit): #ifdef SHARED - b JUMPTARGET(__GI_exit); + b JUMPTARGET(__GI_exit@notoc); #else b JUMPTARGET(exit); nop