glibc/include
Martin Sebor 1626a1cfcd Add support for GCC 9 attribute copy.
GCC 9 has gained an enhancement to help detect attribute mismatches
between alias declarations and their targets.  It consists of a new
warning, -Wattribute-alias, an enhancement to an existing warning,
-Wmissing-attributes, and a new attribute called copy.

The purpose of the warnings is to help identify either possible bugs
(an alias declared with more restrictive attributes than its target
promises) or optimization or diagnostic opportunities (an alias target
missing some attributes that it could be declared with that might
benefit analysis and code generation).  The purpose of the new
attribute is to easily apply (almost) the same set of attributes
to one declaration as those already present on another.

As expected (and intended) the enhancement triggers warnings for
many alias declarations in Glibc code.  This change, tested on
x86_64-linux, avoids all instances of the new warnings by making
use of the attribute where appropriate.  To fully benefit from
the enhancement Glibc will need to be compiled with
 -Wattribute-alias=2 and remaining warnings reviewed and dealt with
(there are a couple of thousand but most should be straightforward
to deal with).

ChangeLog:

	* include/libc-symbols.h (__attribute_copy__): Define macro unless
	it's already defined.
	(_strong_alias): Use __attribute_copy__.
	(_weak_alias,  __hidden_ver1,  __hidden_nolink2): Same.
	* misc/sys/cdefs.h (__attribute_copy__): New macro.
	* sysdeps/x86_64/multiarch/memchr.c (memchr): Use __attribute_copy__.
	* sysdeps/x86_64/multiarch/memcmp.c (memcmp): Same.
	* sysdeps/x86_64/multiarch/mempcpy.c (mempcpy): Same.
	* sysdeps/x86_64/multiarch/memset.c (memset): Same.
	* sysdeps/x86_64/multiarch/stpcpy.c (stpcpy): Same.
	* sysdeps/x86_64/multiarch/strcat.c (strcat): Same.
	* sysdeps/x86_64/multiarch/strchr.c (strchr): Same.
	* sysdeps/x86_64/multiarch/strcmp.c (strcmp): Same.
	* sysdeps/x86_64/multiarch/strcpy.c (strcpy): Same.
	* sysdeps/x86_64/multiarch/strcspn.c (strcspn): Same.
	* sysdeps/x86_64/multiarch/strlen.c (strlen): Same.
	* sysdeps/x86_64/multiarch/strncmp.c (strncmp): Same.
	* sysdeps/x86_64/multiarch/strncpy.c (strncpy): Same.
	* sysdeps/x86_64/multiarch/strnlen.c (strnlen): Same.
	* sysdeps/x86_64/multiarch/strpbrk.c (strpbrk): Same.
	* sysdeps/x86_64/multiarch/strrchr.c (strrchr): Same.
	* sysdeps/x86_64/multiarch/strspn.c (strspn): Same.
2018-11-09 17:24:12 -07:00
..
arpa nss_dns: Replace local declarations with declarations from a header file 2017-04-04 20:56:23 +02:00
bits Add the statx function 2018-07-10 16:14:45 +02:00
gnu Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
net Fix resolver if_* namespace (bug 17717). 2014-12-16 18:18:49 +00:00
netinet Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
programs Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
protocols
rpc Run thread shutdown functions in an explicit order 2018-06-26 15:27:12 +02:00
rpcsvc libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
sys hurd: avoid PLT ref between sendfile and sendfile64 2018-06-16 00:44:57 +02:00
aio.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
aliases.h Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822] 2017-10-01 15:21:00 -07:00
alloc_buffer.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
alloca.h Remove macros extend_alloca, extend_alloca_account [BZ #18023] 2018-06-27 19:20:37 +02:00
allocate_once.h Implement allocate_once for atomic initialization with allocation 2018-05-23 15:27:01 +02:00
argp-fmtstream.h Mark internal argp functions with attribute_hidden [BZ #18822] 2017-10-01 15:10:27 -07:00
argp.h Mark internal argp functions with attribute_hidden [BZ #18822] 2017-10-01 15:10:27 -07:00
argz.h Use libc_hidden_* for argz_next, __argz_next (bug 15105). 2018-02-15 21:00:02 +00:00
array_length.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
assert.h Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN 2017-10-03 01:33:38 +02:00
atomic.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
byteswap.h
complex.h float128: Add private _Float128 declarations for libm. 2017-05-15 10:23:28 -03:00
cpio.h Add more headers to include/ for conform tests. 2014-12-11 21:41:30 +00:00
crypt.h Add include/crypt.h. 2016-10-28 22:40:16 -04:00
ctype.h Use libc_hidden_* for tolower, toupper (bug 15105). 2018-02-23 13:54:53 +00:00
des.h
dirent.h Consolidate scandir{at}{64} implementation 2018-04-20 13:57:12 -03:00
dlfcn.h libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
dso_handle.h Mark __dso_handle as hidden [BZ #18822] 2017-09-26 16:53:44 -07:00
elf.h Properly compute offsets of note descriptor and next note [BZ #22370] 2017-11-28 09:57:00 -08:00
endian.h
envz.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
err.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
errno.h hurd: Fix accessing errno from rtld 2018-03-25 00:48:01 +01:00
error.h
execinfo.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
fcntl.h Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251) 2018-06-26 13:22:53 -03:00
features.h Update NEWS, version.h, and features.h for glibc 2.28. 2018-08-01 01:10:47 -04:00
fenv.h Move fenv.h soft-float inlines from fenv_private.h to include/fenv.h. 2018-09-04 19:52:06 +00:00
float.h Handle more _FloatN, _FloatNx types in include/float.h. 2017-11-07 23:49:04 +00:00
fmtmsg.h Add more headers to include/ for conform tests. 2014-12-11 21:41:30 +00:00
fnmatch.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
fpu_control.h Hide internal __setfpucw function [BZ #18822] 2017-10-01 17:52:15 -07:00
ftw.h
gconv.h
getopt.h getopt: remove USE_NONOPTION_FLAGS 2017-04-07 07:45:53 -04:00
getopt_int.h Update. 2004-03-09 10:36:53 +00:00
glob.h Hide internal __glob64 function [BZ #18822] 2017-10-01 18:02:10 -07:00
gmp.h Mark internal gmp functions with attribute_hidden [BZ #18822] 2017-10-01 15:15:30 -07:00
gnu-versions.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
grp-merge.h NSS: Implement group merging support. 2016-04-29 22:18:21 -04:00
grp.h Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822] 2017-10-01 15:13:13 -07:00
gshadow.h Mark internal gshadow functions with attribute_hidden [BZ #18822] 2017-10-01 15:19:17 -07:00
iconv.h
ifaddrs.h hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition 2017-09-28 01:05:18 +02:00
ifreq.h Hide internal __ifreq function [BZ #18822] 2017-10-01 17:35:46 -07:00
ifunc-impl-list.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
inline-hashtab.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
intprops.h Merge mktime, timegm from upstream Gnulib 2018-09-19 17:09:08 -07:00
inttypes.h Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
langinfo.h Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
libc-diag.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libc-internal.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libc-pointer-arith.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libc-symbols.h Add support for GCC 9 attribute copy. 2018-11-09 17:24:12 -07:00
libgen.h
libintl.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
limits.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
link.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
list.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
list_t.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
locale.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
malloc.h Hide internal __malloc_check_init function [BZ #18822] 2017-10-01 16:00:36 -07:00
math-narrow-eval.h Move math_narrow_eval to separate math-narrow-eval.h. 2018-05-09 00:15:10 +00:00
math.h Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
mcheck.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
memory.h
mntent.h Hide internal __hasmntopt function [BZ #18822] 2017-10-01 17:37:42 -07:00
monetary.h Hide internal __vstrfmon_l function [BZ #18822] 2017-10-01 17:45:07 -07:00
mqueue.h Fix mq_receive, mq_send mq_timed* namespace (bug 18545). 2015-06-17 20:19:04 +00:00
netdb.h Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822] 2017-10-01 15:21:00 -07:00
netgroup.h
nl_types.h
nss.h nss: Export nscd hash function as __nss_hash [BZ #22459] 2017-11-23 14:08:11 +01:00
nsswitch.h
obstack.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
plural-exp.h Hide internal __gettextparse function [BZ #18822] 2017-10-01 17:31:05 -07:00
poll.h
printf.h Hide internal printf functions [BZ #18822/21986] 2017-08-22 07:50:57 -07:00
pthread.h Fix mq_notify pthread_barrier_* namespace (bug 18544). 2015-06-17 20:16:56 +00:00
pty.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
pwd.h Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822] 2017-10-01 15:13:13 -07:00
regex.h Hide internal regex functions [BZ #18822] 2017-10-01 15:53:15 -07:00
resolv.h Obsolete p_secstodate. 2017-11-22 22:21:10 +00:00
rounding-mode.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sched.h Hide internal __sched_setparam function [BZ #18822] 2017-10-01 17:43:25 -07:00
scratch_buffer.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
search.h Hide internal __tdestroy function [BZ #18822] 2017-10-01 16:06:58 -07:00
set-hooks.h libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
setjmp.h Revert "hurd: Avoid PLTs for longjmp & siglongjmp" 2018-04-05 09:38:58 +02:00
sgtty.h
shadow.h Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822] 2017-10-01 15:13:13 -07:00
shlib-compat.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
signal.h Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN 2017-10-03 01:33:38 +02:00
spawn.h posix: Add internal symbols for posix_spawn interface 2018-10-24 15:22:27 -03:00
stab.h
stackinfo.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
stap-probe.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
stdc-predef.h nptl: Add C11 threads thrd_* functions 2018-07-24 14:06:45 -03:00
stdio.h [BZ #20271] Add newlines in __libc_fatal calls. 2018-08-31 18:04:32 -07:00
stdio_ext.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
stdlib.h Use libc_hidden_* for atoi (bug 15105). 2018-02-26 18:17:47 +00:00
string.h Run thread shutdown functions in an explicit order 2018-06-26 15:27:12 +02:00
strings.h
stropts.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h Hide internal __tcgetattr function [BZ #18822] 2017-10-01 17:48:24 -07:00
tgmath.h
time.h Y2038: Add 64-bit time for all architectures 2018-10-24 22:09:34 +02:00
ttyent.h Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
uchar.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
ucontext.h
ulimit.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
unistd.h posix: Fix posix_spawnp to not execute invalid binaries in non compat mode (BZ#23264) 2018-06-08 17:27:46 -03:00
utime.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
utmp.h Mark internal utmp functions with attribute_hidden [BZ #18822] 2017-10-01 15:51:56 -07:00
values.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
verify.h Merge mktime, timegm from upstream Gnulib 2018-09-19 17:09:08 -07:00
wchar.h Remove attribute_hidden for wchar ifunc symbols. 2017-11-21 08:43:23 +01:00
wctype.h Remove __need macros from stdio.h and wchar.h. 2017-06-08 13:58:17 -04:00
wordexp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00