Fix hppa local PLT entries for sigprocmask (bug 18124)

Message ID alpine.DEB.2.20.1802151656150.20178@digraph.polyomino.org.uk
State New, archived
Headers

Commit Message

Joseph Myers Feb. 15, 2018, 4:56 p.m. UTC
  When adding/updating localplt.data for various architectures to get
the compilation tests passing everywhere, I generally made it reflect
the existing state of what local PLT entries were actually seen,
rather than an ideal state with as few as possible such entries,
mainly for functions that are intended to be interposable.

This patch eliminates some local PLT entries for hppa by using
__sigprocmask instead of sigprocmask in getcontext and setcontext.
The specific case of sigprocmask called by setcontext is the third of
four items in bug 18124 (the other three have already been fixed for
2.26 or earlier releases).  Note that hppa-specific localplt.data
entries for __sigsetjmp, _IO_funlockfile and __errno_location remain,
but the causes / fixes are less immediately obvious from source
inspection.

Tested (compilation tests only) with build-many-glibcs.py for
hppa-linux-gnu.

2018-02-15  Joseph Myers  <joseph@codesourcery.com>

	[BZ #18124]
	* sysdeps/hppa/bsd-setjmp.S: Include <sysdep.h>.
	(setjmp): Use HIDDEN_JUMPTARGET with __sigsetjmp.
	* sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Call
	__sigprocmask instead of sigprocmask.
	* sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext):
	Likewise.
	* sysdeps/unix/sysv/linux/hppa/localplt.data: Remove entries for
	__sigsetjmp and sigprocmask.
  

Comments

Carlos O'Donell Feb. 15, 2018, 7:42 p.m. UTC | #1
On 02/15/2018 08:56 AM, Joseph Myers wrote:
> When adding/updating localplt.data for various architectures to get
> the compilation tests passing everywhere, I generally made it reflect
> the existing state of what local PLT entries were actually seen,
> rather than an ideal state with as few as possible such entries,
> mainly for functions that are intended to be interposable.
> 
> This patch eliminates some local PLT entries for hppa by using
> __sigprocmask instead of sigprocmask in getcontext and setcontext.
> The specific case of sigprocmask called by setcontext is the third of
> four items in bug 18124 (the other three have already been fixed for
> 2.26 or earlier releases).  Note that hppa-specific localplt.data
> entries for __sigsetjmp, _IO_funlockfile and __errno_location remain,
> but the causes / fixes are less immediately obvious from source
> inspection.
> 
> Tested (compilation tests only) with build-many-glibcs.py for
> hppa-linux-gnu.
> 
> 2018-02-15  Joseph Myers  <joseph@codesourcery.com>
> 
> 	[BZ #18124]
> 	* sysdeps/hppa/bsd-setjmp.S: Include <sysdep.h>.
> 	(setjmp): Use HIDDEN_JUMPTARGET with __sigsetjmp.
> 	* sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Call
> 	__sigprocmask instead of sigprocmask.
> 	* sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/hppa/localplt.data: Remove entries for
> 	__sigsetjmp and sigprocmask.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>


> diff --git a/sysdeps/unix/sysv/linux/hppa/getcontext.S b/sysdeps/unix/sysv/linux/hppa/getcontext.S
> index 4261f60..b8f978f 100644
> --- a/sysdeps/unix/sysv/linux/hppa/getcontext.S
> +++ b/sysdeps/unix/sysv/linux/hppa/getcontext.S
> @@ -160,7 +160,7 @@ ENTRY(__getcontext)
>  	/* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask);  */
>  	ldo	oSIGMASK(%r26), %r24
>  	copy	%r0, %r25
> -	bl	sigprocmask, %r2
> +	bl	__sigprocmask, %r2
>  	ldi	SIG_BLOCK, %r26
>  
>  	/* Epilogue */
> diff --git a/sysdeps/unix/sysv/linux/hppa/localplt.data b/sysdeps/unix/sysv/linux/hppa/localplt.data
> index 3279c0a..5f3475d 100644
> --- a/sysdeps/unix/sysv/linux/hppa/localplt.data
> +++ b/sysdeps/unix/sysv/linux/hppa/localplt.data
> @@ -8,7 +8,6 @@ libc.so: memalign
>  libc.so: realloc
>  libc.so: __sigsetjmp
>  libc.so: _IO_funlockfile
> -libc.so: sigprocmask
>  libc.so: __errno_location
>  libm.so: matherr
>  libpthread.so: __errno_location
> diff --git a/sysdeps/unix/sysv/linux/hppa/setcontext.S b/sysdeps/unix/sysv/linux/hppa/setcontext.S
> index 8dc0ecf..d5ebc7c 100644
> --- a/sysdeps/unix/sysv/linux/hppa/setcontext.S
> +++ b/sysdeps/unix/sysv/linux/hppa/setcontext.S
> @@ -43,7 +43,7 @@ ENTRY(__setcontext)
>  	/* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL);  */
>  	copy	%r0, %r24
>  	ldo	oSIGMASK(%r3), %r25
> -	bl	sigprocmask, %r2
> +	bl	__sigprocmask, %r2
>  	ldi	SIG_SETMASK, %r26
>  
>  	comib,<>,n 0,%ret0,.Lerror
>
  

Patch

diff --git a/sysdeps/unix/sysv/linux/hppa/getcontext.S b/sysdeps/unix/sysv/linux/hppa/getcontext.S
index 4261f60..b8f978f 100644
--- a/sysdeps/unix/sysv/linux/hppa/getcontext.S
+++ b/sysdeps/unix/sysv/linux/hppa/getcontext.S
@@ -160,7 +160,7 @@  ENTRY(__getcontext)
 	/* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask);  */
 	ldo	oSIGMASK(%r26), %r24
 	copy	%r0, %r25
-	bl	sigprocmask, %r2
+	bl	__sigprocmask, %r2
 	ldi	SIG_BLOCK, %r26
 
 	/* Epilogue */
diff --git a/sysdeps/unix/sysv/linux/hppa/localplt.data b/sysdeps/unix/sysv/linux/hppa/localplt.data
index 3279c0a..5f3475d 100644
--- a/sysdeps/unix/sysv/linux/hppa/localplt.data
+++ b/sysdeps/unix/sysv/linux/hppa/localplt.data
@@ -8,7 +8,6 @@  libc.so: memalign
 libc.so: realloc
 libc.so: __sigsetjmp
 libc.so: _IO_funlockfile
-libc.so: sigprocmask
 libc.so: __errno_location
 libm.so: matherr
 libpthread.so: __errno_location
diff --git a/sysdeps/unix/sysv/linux/hppa/setcontext.S b/sysdeps/unix/sysv/linux/hppa/setcontext.S
index 8dc0ecf..d5ebc7c 100644
--- a/sysdeps/unix/sysv/linux/hppa/setcontext.S
+++ b/sysdeps/unix/sysv/linux/hppa/setcontext.S
@@ -43,7 +43,7 @@  ENTRY(__setcontext)
 	/* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL);  */
 	copy	%r0, %r24
 	ldo	oSIGMASK(%r3), %r25
-	bl	sigprocmask, %r2
+	bl	__sigprocmask, %r2
 	ldi	SIG_SETMASK, %r26
 
 	comib,<>,n 0,%ret0,.Lerror