public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use JUMPTARGET in x86-64 pthread
@ 2016-03-16 15:10 H.J. Lu
  2016-03-18 22:02 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2016-03-16 15:10 UTC (permalink / raw)
  To: GNU C Library

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
-- 
2.5.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Use JUMPTARGET in x86-64 pthread
  2016-03-16 15:10 [PATCH] Use JUMPTARGET in x86-64 pthread H.J. Lu
@ 2016-03-18 22:02 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2016-03-18 22:02 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

OK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-18 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 15:10 [PATCH] Use JUMPTARGET in x86-64 pthread H.J. Lu
2016-03-18 22:02 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).