mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
signal: Move sys_siglist to a compat symbol
The symbol was deprecated by strsignal and its usage imposes issues such as copy relocations. Its internal name is changed to __sys_siglist and __sys_sigabbrev to avoid static linking usage. The compat code is also refactored, since both Linux and Hurd usage the same strategy: export the same array with different object sizes. The libSegfault change avoids calling strsignal on the SIGFAULT signal handler (the current usage is already sketchy, adding a call that potentially issue locale internal function is even sketchier). Checked on x86_64-linux-gnu and i686-linux-gnu. I also run a check-abi on all affected platforms. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
@ -80,7 +80,7 @@ psiginfo (const siginfo_t *pinfo, const char *s)
|
||||
|
||||
const char *desc;
|
||||
if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
|
||||
&& ((desc = _sys_siglist[pinfo->si_signo]) != NULL
|
||||
&& ((desc = __sys_siglist[pinfo->si_signo]) != NULL
|
||||
#ifdef SIGRTMIN
|
||||
|| (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX)
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@ psignal (int sig, const char *s)
|
||||
else
|
||||
colon = ": ";
|
||||
|
||||
if (sig >= 0 && sig < NSIG && (desc = _sys_siglist[sig]) != NULL)
|
||||
if (sig >= 0 && sig < NSIG && (desc = __sys_siglist[sig]) != NULL)
|
||||
(void) __fxprintf (NULL, "%s%s%s\n", s, colon, _(desc));
|
||||
else
|
||||
{
|
||||
|
@ -20,17 +20,19 @@
|
||||
#include <signal.h>
|
||||
#include <libintl.h>
|
||||
|
||||
const char *const _sys_siglist[NSIG] =
|
||||
const char *const __sys_siglist[NSIG] =
|
||||
{
|
||||
#define init_sig(sig, abbrev, desc) [sig] = desc,
|
||||
#include <siglist.h>
|
||||
#undef init_sig
|
||||
};
|
||||
libc_hidden_def (__sys_siglist)
|
||||
|
||||
|
||||
const char *const _sys_sigabbrev[NSIG] =
|
||||
const char *const __sys_sigabbrev[NSIG] =
|
||||
{
|
||||
#define init_sig(sig, abbrev, desc) [sig] = abbrev,
|
||||
#include <siglist.h>
|
||||
#undef init_sig
|
||||
};
|
||||
|
||||
#include <siglist-compat.c>
|
||||
|
Reference in New Issue
Block a user