about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-01 16:04:26 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-01 16:04:41 -0700
commit6a088436d4c04b8081e86f9e856f10fba97d0612 (patch)
tree2c229f425eba248cdc13454a71d594d237b87a81
parent78cf1d74d28c9312d888dea1ad3de01d38c5fc4a (diff)
downloadglibc-6a088436d4c04b8081e86f9e856f10fba97d0612.tar.gz
glibc-6a088436d4c04b8081e86f9e856f10fba97d0612.tar.xz
glibc-6a088436d4c04b8081e86f9e856f10fba97d0612.zip
Hide internal signal functions [BZ #18822]
Hide internal signal functions to allow direct access within libc.so and
libc.a without using GOT nor PLT.

__GI___kill and __GI___sigaltstack are defined when syscalls.list is
used to generate them.  Otherwise libc_hidden_def is needed explicitly.

	[BZ #18822]
	* include/signal.h (__kill): Add libc_hidden_proto.
	(__sigblock): Likewise.
	(__sigprocmask): Likewise.
	(__sigaltstack): Likewise.
	* signal/kill.c (__kill): Add libc_hidden_def.
	* signal/sigblock.c (__sigblock): Likewise.
	* signal/sigprocmask.c (__sigprocmask): Likewise.
	* sysdeps/mach/hurd/kill.c (__kill): Likewise.
	* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
	* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise.
	* sysdeps/posix/sigblock.c (__sigblock): Likewise.
	* sysdeps/unix/sysv/linux/alpha/sigprocmask.c (__sigprocmask):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
	(__sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask):
	Likewise.
	* /sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
	(__sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask):
	Likewise.
-rw-r--r--ChangeLog27
-rw-r--r--include/signal.h4
-rw-r--r--signal/kill.c1
-rw-r--r--signal/sigblock.c1
-rw-r--r--signal/sigprocmask.c1
-rw-r--r--sysdeps/mach/hurd/kill.c1
-rw-r--r--sysdeps/mach/hurd/sigaltstack.c1
-rw-r--r--sysdeps/mach/hurd/sigprocmask.c1
-rw-r--r--sysdeps/posix/sigblock.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigprocmask.c1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigprocmask.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c1
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigprocmask.c1
15 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dcf1c0d090..9397cdf562 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,33 @@
 2017-10-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #18822]
+	* include/signal.h (__kill): Add libc_hidden_proto.
+	(__sigblock): Likewise.
+	(__sigprocmask): Likewise.
+	(__sigaltstack): Likewise.
+	* signal/kill.c (__kill): Add libc_hidden_def.
+	* signal/sigblock.c (__sigblock): Likewise.
+	* signal/sigprocmask.c (__sigprocmask): Likewise.
+	* sysdeps/mach/hurd/kill.c (__kill): Likewise.
+	* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
+	* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise.
+	* sysdeps/posix/sigblock.c (__sigblock): Likewise.
+	* sysdeps/unix/sysv/linux/alpha/sigprocmask.c (__sigprocmask):
+	Likewise.
+	* sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask):
+	Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
+	(__sigprocmask): Likewise.
+	* sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask):
+	Likewise.
+	* /sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
+	(__sigprocmask): Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask):
+	Likewise.
+
+2017-10-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #18822]
 	* include/string.h (__strsep): Add libc_hidden_proto.
 	* string/strsep.c (__strsep): Add libc_hidden_def.
 
diff --git a/include/signal.h b/include/signal.h
index 61ad422dcb..7cbe64b8ad 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -17,13 +17,16 @@ libc_hidden_proto (_sys_siglist)
 /* Now define the internal interfaces.  */
 extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);
 extern int __kill (__pid_t __pid, int __sig);
+libc_hidden_proto (__kill)
 extern int __sigaction (int __sig, const struct sigaction *__restrict __act,
 			struct sigaction *__restrict __oact);
 libc_hidden_proto (__sigaction)
 extern int __sigblock (int __mask);
+libc_hidden_proto (__sigblock)
 extern int __sigsetmask (int __mask);
 extern int __sigprocmask (int __how,
 			  const sigset_t *__set, sigset_t *__oset);
+libc_hidden_proto (__sigprocmask)
 extern int __sigsuspend (const sigset_t *__set);
 libc_hidden_proto (__sigsuspend)
 extern int __sigwait (const sigset_t *__set, int *__sig);
@@ -40,6 +43,7 @@ extern int __sigreturn (struct sigcontext *__scp);
 #endif
 extern int __sigaltstack (const stack_t *__ss,
 			  stack_t *__oss);
+libc_hidden_proto (__sigaltstack)
 extern int __libc_sigaction (int sig, const struct sigaction *act,
 			     struct sigaction *oact);
 libc_hidden_proto (__libc_sigaction)
diff --git a/signal/kill.c b/signal/kill.c
index c7591b10c1..66f85d127c 100644
--- a/signal/kill.c
+++ b/signal/kill.c
@@ -30,4 +30,5 @@ __kill (int pid, int sig)
 }
 stub_warning (kill)
 
+libc_hidden_def (__kill)
 weak_alias (__kill, kill)
diff --git a/signal/sigblock.c b/signal/sigblock.c
index a8be9dbde9..fca370a52d 100644
--- a/signal/sigblock.c
+++ b/signal/sigblock.c
@@ -27,4 +27,5 @@ __sigblock (int mask)
 }
 stub_warning (sigblock)
 
+libc_hidden_def (__sigblock)
 weak_alias (__sigblock, sigblock)
diff --git a/signal/sigprocmask.c b/signal/sigprocmask.c
index afcf5a116e..ca9bb556b8 100644
--- a/signal/sigprocmask.c
+++ b/signal/sigprocmask.c
@@ -44,4 +44,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
    and we don't want warnings for every use of abort on
    a system without safe signals.  */
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/mach/hurd/kill.c b/sysdeps/mach/hurd/kill.c
index 2d556dd2ff..5360bb52c5 100644
--- a/sysdeps/mach/hurd/kill.c
+++ b/sysdeps/mach/hurd/kill.c
@@ -146,4 +146,5 @@ __kill (pid_t pid, int sig)
   return delivered ? 0 : __hurd_fail (err ?: ESRCH);
 }
 
+libc_hidden_def (__kill)
 weak_alias (__kill, kill)
diff --git a/sysdeps/mach/hurd/sigaltstack.c b/sysdeps/mach/hurd/sigaltstack.c
index 4fba69e766..3fde510e23 100644
--- a/sysdeps/mach/hurd/sigaltstack.c
+++ b/sysdeps/mach/hurd/sigaltstack.c
@@ -57,4 +57,5 @@ __sigaltstack (const stack_t *argss, stack_t *oss)
 
   return 0;
 }
+libc_hidden_def (__sigaltstack)
 weak_alias (__sigaltstack, sigaltstack)
diff --git a/sysdeps/mach/hurd/sigprocmask.c b/sysdeps/mach/hurd/sigprocmask.c
index a4ebe580ff..70b9a10a7b 100644
--- a/sysdeps/mach/hurd/sigprocmask.c
+++ b/sysdeps/mach/hurd/sigprocmask.c
@@ -80,4 +80,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
   return 0;
 }
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/posix/sigblock.c b/sysdeps/posix/sigblock.c
index 1f8686458b..ab59f2968f 100644
--- a/sysdeps/posix/sigblock.c
+++ b/sysdeps/posix/sigblock.c
@@ -35,4 +35,5 @@ __sigblock (int mask)
   return sigset_get_old_mask (&oset);
 }
 
+libc_hidden_def (__sigblock)
 weak_alias (__sigblock, sigblock)
diff --git a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
index 39a07de475..ebec70cff0 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
@@ -54,4 +54,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
   return 0;
 }
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask);
diff --git a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
index 7e62438b03..920c5fd052 100644
--- a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
@@ -36,4 +36,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
index 4cbbc8e133..a8010e7f14 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
@@ -34,4 +34,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index e39e5f6872..d0b8e049b2 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -53,4 +53,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
 
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
index c2205d0044..ef7d7feb49 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
@@ -30,4 +30,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
index a87ad106ea..1610ddf47f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
@@ -35,4 +35,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)