This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't call internal __pthread_unwind via PLT


On Wed, May 4, 2016 at 10:54 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> There is no need to call the internal funtion, __GI___pthread_unwind,
> in x86-64 cancellation.S.
>
> Tested on x86-64.  OK for master?
>
> H.J.
> ---
>         * sysdeps/unix/sysv/linux/x86_64/cancellation.S (JUMPTARGET): New
>         if __pthread_unwind defined to __GI___pthread_unwind.


I am going to check in this updated patch.

-- 
H.J.
From 5fe984ca739b566ffa7982005927b2ddc7925a87 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 4 May 2016 10:46:18 -0700
Subject: [PATCH] Don't call internal __pthread_unwind via PLT

Add PTHREAD_UNWIND to replace JUMPTARGET(__pthread_unwind) and define
it to __GI___pthread_unwind within libpthread.

	* sysdeps/unix/sysv/linux/x86_64/cancellation.S (PTHREAD_UNWIND):
	New
	(__pthread_unwind): Renamed to ...
	(PTHREAD_UNWIND): This.
	(__pthread_enable_asynccancel): Replace
	JUMPTARGET(__pthread_unwind) with PTHREAD_UNWIND.
---
 sysdeps/unix/sysv/linux/x86_64/cancellation.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 04a0e59..bd22aa0 100644
--- a/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -21,9 +21,11 @@
 #include <kernel-features.h>
 #include "lowlevellock.h"
 
+#define PTHREAD_UNWIND JUMPTARGET(__pthread_unwind)
 #if IS_IN (libpthread)
 # if defined SHARED && !defined NO_HIDDEN
-#  define __pthread_unwind __GI___pthread_unwind
+#  undef PTHREAD_UNWIND
+#  define PTHREAD_UNWIND __GI___pthread_unwind
 # endif
 #else
 # ifndef SHARED
@@ -76,7 +78,7 @@ ENTRY(__pthread_enable_asynccancel)
 	lock
 	orl	$TCB_EXITING_BITMASK, %fs:CANCELHANDLING
 	mov	%fs:CLEANUP_JMP_BUF, %RDI_LP
-	call	JUMPTARGET(__pthread_unwind)
+	call	PTHREAD_UNWIND
 	hlt
 END(__pthread_enable_asynccancel)
 
-- 
2.5.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]