From patchwork Wed Mar 16 15:09:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 11351 Received: (qmail 67102 invoked by alias); 16 Mar 2016 15:10:08 -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 66999 invoked by uid 89); 16 Mar 2016 15:10:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=sk:__pthre, 5867, rdi, H*R:D*gmail.com X-HELO: mga02.intel.com X-ExtLoop1: 1 Date: Wed, 16 Mar 2016 08:09:24 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Use JUMPTARGET in x86-64 pthread Message-ID: <20160316150924.GA10853@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) When PLT may be used, JUMPTARGET should be used instead calling the function directly. Tested on x86-64. OK for master? H.J. --- * sysdeps/unix/sysv/linux/x86_64/cancellation.S (__pthread_enable_asynccancel): Use JUMPTARGET to call __pthread_unwind. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S (__condvar_cleanup2): Use JUMPTARGET to call _Unwind_Resume. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (__condvar_cleanup1): Likewise. --- sysdeps/unix/sysv/linux/x86_64/cancellation.S | 6 +----- sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S | 2 +- sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/sysdeps/unix/sysv/linux/x86_64/cancellation.S index 687057d..04a0e59 100644 --- a/sysdeps/unix/sysv/linux/x86_64/cancellation.S +++ b/sysdeps/unix/sysv/linux/x86_64/cancellation.S @@ -76,11 +76,7 @@ ENTRY(__pthread_enable_asynccancel) lock orl $TCB_EXITING_BITMASK, %fs:CANCELHANDLING mov %fs:CLEANUP_JMP_BUF, %RDI_LP -#ifdef SHARED - call __pthread_unwind@PLT -#else - call __pthread_unwind -#endif + call JUMPTARGET(__pthread_unwind) hlt END(__pthread_enable_asynccancel) diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 9a63314..a2adc09 100644 --- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -586,7 +586,7 @@ __condvar_cleanup2: movq FRAME_SIZE+16(%rsp), %r13 movq FRAME_SIZE+24(%rsp), %r12 .LcallUR: - call _Unwind_Resume@PLT + call JUMPTARGET(_Unwind_Resume) hlt .LENDCODE: cfi_endproc diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S index ed93d5d..c4d3504 100644 --- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S +++ b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S @@ -518,7 +518,7 @@ __condvar_cleanup1: 8: movq 24(%rsp), %rdi .LcallUR: - call _Unwind_Resume@PLT + call JUMPTARGET(_Unwind_Resume) hlt .LENDCODE: cfi_endproc