diff mbox

powerpc: Add hidden definition for __sigsetjmp

Message ID 64ac2ecb-04ca-cf8d-2be2-71bf25636f2f@redhat.com
State Accepted
Commit b36528936449d2e800db8833869d108a20653c96
Headers show

Commit Message

Florian Weimer Nov. 22, 2016, 5:03 p.m. UTC
I'm reposting this previously submitted patch.  Andreas pointed out that 
it is harmless (no ABI impact), and it is a prerequisite of implementing 
full ld.so exception handling in libc.so (where the required TLS data is 
directly available).

The internal headers already assume that such a hidden definition 
exists, but there is currently no reference in glibc, so this wasn't 
visible.

Thanks,
Florian
diff mbox

Patch

powerpc: Add hidden definition for __sigsetjmp

2016-11-14  Florian Weimer  <fweimer@redhat.com>

	* sysdeps/powerpc/powerpc64/setjmp-common.S (__GI___sigsetjmp):
	Define.
	* sysdeps/powerpc/powerpc32/setjmp.S (__sigsetjmp): Add hidden
	definition.

diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
index 6a4016c..de6cdcf 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
@@ -32,6 +32,7 @@  versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
 # define __sigsetjmp_symbol __vmx__sigsetjmp
 # define __sigjmp_save_symbol __vmx__sigjmp_save
 # include "setjmp-common.S"
+libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp)
 
 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
 #  define __NO_VMX__
diff --git a/sysdeps/powerpc/powerpc32/setjmp.S b/sysdeps/powerpc/powerpc32/setjmp.S
index 88f7f82..285d40c 100644
--- a/sysdeps/powerpc/powerpc32/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/setjmp.S
@@ -31,6 +31,7 @@  versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
 # define __sigsetjmp_symbol __vmx__sigsetjmp
 # define __sigjmp_save_symbol __vmx__sigjmp_save
 # include "setjmp-common.S"
+libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp)
 
 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
 #  define __NO_VMX__
diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S
index 83361f5..b5de49e 100644
--- a/sysdeps/powerpc/powerpc64/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/setjmp-common.S
@@ -232,3 +232,14 @@  L(no_vmx):
 	blr
 #endif
 END (__sigsetjmp_symbol)
+
+#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__
+/* When called from within libc we need a special version of __sigsetjmp
+   that saves r2 since the call won't go via a plt call stub.  See
+   bugz #269.  */
+ENTRY (__GI___sigsetjmp)
+	std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area.  */
+	CALL_MCOUNT 1
+	b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent))
+END (__GI___sigsetjmp)
+#endif