From 5be8418cb0856aff4de059802570eb12d558c91f Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 29 May 2012 23:55:13 +0200 Subject: [PATCH] Remove use of INTDEF/INTUSE in stdio-common --- ChangeLog | 21 +++++++++++++++++++++ elf/dl-minimal.c | 8 +++----- elf/dl-reloc.c | 6 +++--- include/signal.h | 1 + stdio-common/_itoa.c | 23 ++++------------------- stdio-common/itoa-digits.c | 6 ++++-- stdio-common/itoa-udigits.c | 6 ++++-- stdio-common/psiginfo.c | 9 ++------- stdio-common/psignal.c | 11 ++--------- string/strsignal.c | 8 ++------ sysdeps/generic/_itoa.h | 16 ++++++---------- sysdeps/gnu/siglist.c | 5 ++--- 12 files changed, 54 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22315d7..6cf3b1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2012-06-01 Andreas Schwab + + [BZ #14132] + * elf/dl-reloc.c: Include <_itoa.h>. + (_dl_reloc_bad_type): Remove use of INTUSE. + * elf/dl-minimal.c (_itoa, _itoa_lower_digits): Likewise. + * stdio-common/_itoa.c (_itoa_word, _itoa): Likewise. + * stdio-common/psiginfo.c (psiginfo): Likewise. + * stdio-common/psignal.c (psignal): Likewise. + * string/strsignal.c (strsignal): Likewise. + * include/signal.h (_sys_siglist): Declare hidden proto. + * stdio-common/itoa-digits.c: Include <_itoa.h>. Replace + INTVARDEF with libc_hidden_data_def. + * stdio-common/itoa-udigits.c: Likewise. + * sysdeps/generic/_itoa.h (_itoa_upper_digits_internal) + (_itoa_lower_digits_internal): Remove declaration. + (_itoa_upper_digits, _itoa_lower_digits): Declare hidden proto. + * sysdeps/gnu/siglist.c (_sys_siglist_internal) + (_sys_sigabbrev_internal): Remove aliases. + (_sys_siglist): Define hidden alias. + 2012-05-31 Markus Trippelsdorf * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index 4a97f56..a8b2d4f 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -315,12 +315,10 @@ _itoa (value, buflim, base, upper_case) unsigned int base; int upper_case; { - extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden; - assert (! upper_case); do - *--buflim = INTUSE(_itoa_lower_digits)[value % base]; + *--buflim = _itoa_lower_digits[value % base]; while ((value /= base) != 0); return buflim; @@ -380,5 +378,5 @@ rtld_hidden_def (__chk_fail) /* The '_itoa_lower_digits' variable in libc.so is able to handle bases up to 36. We don't need this here. */ -const char INTUSE(_itoa_lower_digits)[16] attribute_hidden - = "0123456789abcdef"; +const char _itoa_lower_digits[16] = "0123456789abcdef"; +rtld_hidden_data_def (_itoa_lower_digits) diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index 97d2f6f..e6968a4 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -1,5 +1,5 @@ /* Relocate a shared object and resolve its references to other loaded objects. - Copyright (C) 1995-2006, 2008-2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +24,7 @@ #include #include #include +#include <_itoa.h> #include "dynamic-link.h" /* Statistics function. */ @@ -338,8 +339,7 @@ void internal_function __attribute_noinline__ _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt) { - extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden; -#define DIGIT(b) INTUSE(_itoa_lower_digits)[(b) & 0xf]; +#define DIGIT(b) _itoa_lower_digits[(b) & 0xf]; /* XXX We cannot translate these messages. */ static const char msg[2][32 diff --git a/include/signal.h b/include/signal.h index c43f2ab..a019395 100644 --- a/include/signal.h +++ b/include/signal.h @@ -14,6 +14,7 @@ libc_hidden_proto (__sigpause) libc_hidden_proto (raise) libc_hidden_proto (__libc_current_sigrtmin) libc_hidden_proto (__libc_current_sigrtmax) +libc_hidden_proto (_sys_siglist) /* Now define the internal interfaces. */ extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler); diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index 12d6954..ebb3e85 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -1,6 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2007 - Free Software Foundation, Inc. + Copyright (C) 1994-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Torbjorn Granlund and Ulrich Drepper . @@ -160,27 +159,13 @@ const struct base_table_t _itoa_base_table[] attribute_hidden = }; #endif -/* Lower-case digits. */ -extern const char _itoa_lower_digits[]; -extern const char _itoa_lower_digits_internal[] attribute_hidden; -/* Upper-case digits. */ -extern const char _itoa_upper_digits[]; -extern const char _itoa_upper_digits_internal[] attribute_hidden; - - char * _itoa_word (_ITOA_WORD_TYPE value, char *buflim, unsigned int base, int upper_case) { const char *digits = (upper_case -#if !defined NOT_IN_libc || defined IS_IN_rtld - ? INTUSE(_itoa_upper_digits) - : INTUSE(_itoa_lower_digits) -#else ? _itoa_upper_digits - : _itoa_lower_digits -#endif - ); + : _itoa_lower_digits); switch (base) { @@ -213,8 +198,8 @@ _itoa (value, buflim, base, upper_case) int upper_case; { const char *digits = (upper_case - ? INTUSE(_itoa_upper_digits) - : INTUSE(_itoa_lower_digits)); + ? _itoa_upper_digits + : _itoa_lower_digits); const struct base_table_t *brec = &_itoa_base_table[base - 2]; switch (base) diff --git a/stdio-common/itoa-digits.c b/stdio-common/itoa-digits.c index b0a652d..e38f484 100644 --- a/stdio-common/itoa-digits.c +++ b/stdio-common/itoa-digits.c @@ -1,5 +1,5 @@ /* Digits. - Copyright (C) 1994,1995,1996,1999,2000,2002 Free Software Foundation, Inc. + Copyright (C) 1994-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,9 @@ License along with the GNU C Library; if not, see . */ +#include <_itoa.h> + /* Lower-case digits. */ const char _itoa_lower_digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz"; -INTVARDEF(_itoa_lower_digits) +libc_hidden_data_def (_itoa_lower_digits) diff --git a/stdio-common/itoa-udigits.c b/stdio-common/itoa-udigits.c index 39f9549..215af71 100644 --- a/stdio-common/itoa-udigits.c +++ b/stdio-common/itoa-udigits.c @@ -1,5 +1,5 @@ /* Digits. - Copyright (C) 1994,1995,1996,1999,2000,2002 Free Software Foundation, Inc. + Copyright (C) 1994-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,9 @@ License along with the GNU C Library; if not, see . */ +#include <_itoa.h> + /* Upper-case digits. */ const char _itoa_upper_digits[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -INTVARDEF(_itoa_upper_digits) +libc_hidden_data_def (_itoa_upper_digits) diff --git a/stdio-common/psiginfo.c b/stdio-common/psiginfo.c index eb758c4..9701fcd 100644 --- a/stdio-common/psiginfo.c +++ b/stdio-common/psiginfo.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,11 +26,6 @@ #include -/* Defined in sys_siglist.c. */ -extern const char *const _sys_siglist[]; -extern const char *const _sys_siglist_internal[] attribute_hidden; - - #define MF(l) MF1 (l) #define MF1(l) str_##l #define C(s1, s2) C1 (s1, s2) @@ -84,7 +79,7 @@ psiginfo (const siginfo_t *pinfo, const char *s) const char *desc; if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG - && ((desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL + && ((desc = _sys_siglist[pinfo->si_signo]) != NULL #ifdef SIGRTMIN || (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX) #endif diff --git a/stdio-common/psignal.c b/stdio-common/psignal.c index 23026f9..309803a 100644 --- a/stdio-common/psignal.c +++ b/stdio-common/psignal.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 2001, 2002, 2004, 2005, 2009 - Free Software Foundation, Inc. +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,12 +21,6 @@ #include #include - -/* Defined in sys_siglist.c. */ -extern const char *const _sys_siglist[]; -extern const char *const _sys_siglist_internal[] attribute_hidden; - - /* Print out on stderr a line consisting of the test in S, a colon, a space, a message describing the meaning of the signal number SIG and a newline. If S is NULL or "", the colon and space are omitted. */ @@ -41,7 +34,7 @@ psignal (int sig, const char *s) else colon = ": "; - if (sig >= 0 && sig < NSIG && (desc = INTUSE(_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 { diff --git a/string/strsignal.c b/string/strsignal.c index 74ebe36..c6b6a53 100644 --- a/string/strsignal.c +++ b/string/strsignal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994-2002, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,10 +22,6 @@ #include #include - -/* Defined in siglist.c. */ -extern const char *const _sys_siglist[]; -extern const char *const _sys_siglist_internal[] attribute_hidden; static __libc_key_t key; /* If nonzero the key allocation failed and we should better use a @@ -55,7 +51,7 @@ strsignal (int signum) (signum >= SIGRTMIN && signum <= SIGRTMAX) || #endif signum < 0 || signum >= NSIG - || (desc = INTUSE(_sys_siglist)[signum]) == NULL) + || (desc = _sys_siglist[signum]) == NULL) { char *buffer = getbuffer (); int len; diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h index 0a67043..2ab401d 100644 --- a/sysdeps/generic/_itoa.h +++ b/sysdeps/generic/_itoa.h @@ -1,5 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994-1999,2002,2003,2007 Free Software Foundation, Inc. + Copyright (C) 1994-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,9 +45,11 @@ extern char *_itoa (unsigned long long int value, char *buflim, unsigned int base, int upper_case); extern const char _itoa_upper_digits[]; -extern const char _itoa_upper_digits_internal[] attribute_hidden; extern const char _itoa_lower_digits[]; -extern const char _itoa_lower_digits_internal[] attribute_hidden; +#if !defined NOT_IN_libc || defined IS_IN_rtld +hidden_proto (_itoa_upper_digits) +hidden_proto (_itoa_lower_digits) +#endif #ifndef NOT_IN_libc extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim, @@ -58,14 +60,8 @@ _itoa_word (_ITOA_WORD_TYPE value, char *buflim, unsigned int base, int upper_case) { const char *digits = (upper_case -# if defined IS_IN_rtld - ? INTUSE(_itoa_upper_digits) - : INTUSE(_itoa_lower_digits) -# else ? _itoa_upper_digits - : _itoa_lower_digits -# endif - ); + : _itoa_lower_digits); switch (base) { diff --git a/sysdeps/gnu/siglist.c b/sysdeps/gnu/siglist.c index 61a0b82..1a7e38d 100644 --- a/sysdeps/gnu/siglist.c +++ b/sysdeps/gnu/siglist.c @@ -1,5 +1,5 @@ /* Define list of all signal numbers and their names. - Copyright (C) 1997-2000, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,7 +28,7 @@ const char *const __new_sys_siglist[NSIG] = #include #undef init_sig }; -strong_alias (__new_sys_siglist, _sys_siglist_internal) +libc_hidden_ver (__new_sys_siglist, _sys_siglist) const char *const __new_sys_sigabbrev[NSIG] = { @@ -36,7 +36,6 @@ const char *const __new_sys_sigabbrev[NSIG] = #include #undef init_sig }; -strong_alias (__new_sys_sigabbrev, _sys_sigabbrev_internal) #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) declare_symbol_alias (__old_sys_siglist, __new_sys_siglist, object, -- 2.7.4