Commit Graph

1008 Commits

Author SHA1 Message Date
Joseph Myers 9975e3d37d Fix locale memmem namespace (bug 17585).
Locale code, brought in by ISO C functions, calls memmem, which is not
an ISO C function.  This isn't an ISO C conformance bug, because all
mem* names are reserved, but glibc practice is not to rely on that
reservation (thus, memmem is only declared in string.h if __USE_GNU
even though ISO C would allow it to be declared unconditionally, for
example).  This patch changes that code to use __memmem.

Note: there are uses of memmem elsewhere in glibc that I didn't
change, although it may turn out some of those also need to use
__memmem.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17585]
	* string/memmem.c [!_LIBC] (__memmem): Define to memmem.
	(memmem): Rename to __memmem and define as weak alias of
	__memmem.  Use libc_hidden_weak.
	(__memmem): Use libc_hidden_def.
	* include/string.h (__memmem): Declare.  Use libc_hidden_proto.
	* locale/findlocale.c (valid_locale_name): Use __memmem instead of
	memmem.
2014-11-12 22:41:03 +00:00
Joseph Myers c4eae75271 Fix __get_nprocs fgets_unlocked namespace (bug 17582).
__get_nprocs is called from malloc code, but calls fgets_unlocked,
which is not an ISO C or POSIX function.  This patch fixes it to call
a new __fgets_unlocked name instead.

Note: there are various other uses of fgets_unlocked in glibc's
libraries, and I haven't yet investigated which others might also be
problematic (called directly or indirectly from standard functions)
and so need to change to use __fgets_unlocked.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17582]
	* libio/iofgets.c [weak_alias && !_IO_MTSAFE_IO]
	(__fgets_unlocked): Add alias of _IO_fgets.  Use libc_hidden_def.
	* libio/iofgets_u.c (fgets_unlocked): Rename to __fgets_unlocked
	and define as weak alias of __fgets_unlocked.  Use
	libc_hidden_weak.
	(__fgets_unlocked): Use libc_hidden_def.
	* include/stdio.h (__fgets_unlocked): Declare.  Use
	libc_hidden_proto.
	* sysdeps/unix/sysv/linux/getsysstats.c (phys_pages_info): Use
	__fgets_unlocked instead of fgets_unlocked.
	* sysdeps/unix/sysv/linux/alpha/getsysstats.c
	(GET_NPROCS_CONF_PARSER): Likewise.
	* sysdeps/unix/sysv/linux/sparc/getsysstats.c
	(GET_NPROCS_CONF_PARSER): Likewise.
2014-11-12 22:39:36 +00:00
Joseph Myers 01cad84e19 Fix __printf_fp wmemset namespace (bug 17574).
__printf_fp calls wmemset, but that is not an ISO C90 function.  This
patch fixes it to call a new __wmemset name instead (with wmemset
being a weak alias).

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17574]
	* wcsmbs/wmemset.c (wmemset): Rename to __wmemset and define as
	weak alias of __wmemset.  Use libc_hidden_weak.
	(__wmemset): Use libc_hidden_def.
	* include/wchar.h (__wmemset): Declare.  Use libc_hidden_proto.
	* stdio-common/printf_fp.c (___printf_fp): Call __wmemset instead
	of wmemset.
2014-11-12 22:38:11 +00:00
Joseph Myers 939da41143 Fix stpcpy / mempcpy namespace (bug 17573).
Various glibc functions call __stpcpy and __mempcpy for namespace
reasons instead of plain stpcpy and mempcpy.  But __stpcpy and
__mempcpy are macros that call __builtin_stpcpy and __builtin_mempcpy,
and unless GCC optimizes the calls, they end up calling the C
functions stpcpy and mempcpy.

For calls from within shared libc, libc_hidden_builtin_proto ensures
that calls to those C functions are in turn mapped to call __GI_stpcpy
and __GI_mempcpy.  However, for static libc, and for calls from shared
libraries other than libc, the ELF symbols stpcpy and mempcpy end up
getting called, breaking the ISO C namespace (in the case of stpcpy)
or glibc conventions about not relying on the "future library
directions" reservations (in the case of mempcpy).

This patch fixes this by adding declarations of these functions to
include/string.h, under an appropriate condition, with __asm__ used to
change the assembler name used for calls (the mempcpy case was
previously discussed, and the approach for the fix is as I suggested
in <https://sourceware.org/ml/libc-alpha/2013-02/msg00063.html>).

Tested for x86_64 with the testsuite; also checked that dcigettext.o
(an example previously noted of undesired calls to stpcpy and mempcpy)
now calls __stpcpy and __mempcpy instead, as do non-libc shared
libraries (__stpcpy and __mempcpy were already exported from shared
libc).  Disassembly of installed shared libraries isn't easy to
compare because of reordered PLT entries resulting from the change in
functions called (libnsl, libnss_compat, libnss_dns, libnss_files,
libnss_hesiod, libnss_nis, libnss_nisplus, libpthread, librt all have
such changes).

	[BZ #17573]
	* include/string.h [NOT_IN_libc || !SHARED] (mempcpy): Declare
	with asm name __mempcpy.
	[NOT_IN_libc || !SHARED] (stpcpy): Declare with asm name __stpcpy.
2014-11-12 22:36:34 +00:00
Joseph Myers bef8fd6013 Fix qsort_r namespace (bug 17571).
qsort_r is defined in the same file as qsort, but is not an ISO C
function, so should be a weak alias for __qsort_r.  The uses in
getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX
function and qsort_r isn't.  This patch implements this.  Because nscd
uses the getaddrinfo sources outside libc, as do the tst-rfc3484
tests, a #define of __qsort_r to qsort_r is added there alongside the
similar defines for other libc-internal symbols used in getaddrinfo.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17571]
	* stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak
	alias of __qsort_r.
	(qsort): Call __qsort_r instead of qsort_r.
	* include/stdlib.h (qsort_r): Do not call libc_hidden_proto.
	(__qsort_r): Declare.  Call libc_hidden_proto.
	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r
	instead of qsort_r.
	* nscd/gai.c (__qsort_r): Define to qsort_r.
	* posix/tst-rfc3484.c (__qsort_r): Likewise.
	* posix/tst-rfc3484-2.c (__qsort_r): Likewise.
	* posix/tst-rfc3484-3.c (__qsort_r): Likewise.
2014-11-12 22:33:41 +00:00
Joseph Myers 2f5c1b000a Fix __getcwd rewinddir namespace (bug 17584).
__getcwd is called from dcigettext.o (brought in by various ISO C
functionality), but calls rewinddir, which is not an ISO C function.
This patch makes __getcwd call __rewinddir instead and makes rewinddir
a weak alias for __rewinddir.

Since getcwd.c is shared with gnulib (albeit not merged in either
direction for a long time, and omitted from gnulib's
config/srclist.txt list of shared files) I put in a #ifndef _LIBC
define of __rewinddir to rewinddir, although a future merged version
of getcwd could end up looking significantly different.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17584]
	* dirent/rewinddir.c (rewinddir): Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/mach/hurd/rewinddir.c: Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/posix/rewinddir.c: Rename to __rewinddir and define as
	weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* include/dirent.h (rewinddir): Don't use libc_hidden_proto.
	(__rewinddir): Use libc_hidden_proto.
	* sysdeps/posix/getcwd.c [!_LIBC] (__rewinddir): Define to
	rewinddir.
	(__getcwd): Use __rewinddir instead of rewinddir.
2014-11-12 16:24:16 +00:00
Joseph Myers 5a6fa4d7ed Fix tzfile.c namespace (bug 17583).
tzfile.c is brought in by various ISO C functions, but calls fileno,
fread_unlocked and ftello, which are not ISO C functions.  This patch
adds names __fileno, __fread_unlocked and __ftello for those
functions, making tzfile.c use those new names.

Note: there are various uses of fileno elsewhere in glibc that I
didn't change, although it may turn out that some of those also need
to use __fileno.

Tested for x86_64 with the glibc testsuite.  Changed line numbers in
tzfile.c cause changes in assertions, and for some reason this ends up
with different instruction choice and register allocation, affecting
the size of __tzfile_read and so making comparison of disassembly for
libc.so problematic.

	[BZ #17583]
	* libio/fileno.c (fileno): Rename to __fileno and define as weak
	alias of __fileno.  Use libc_hidden_weak.
	(__fileno): Use libc_hidden_def.
	[weak_alias] (fileno_unlocked): Define as weak alias of __fileno.
	* libio/ftello.c (ftello): Rename to __ftello and define as weak
	alias of __ftello.
	[__OFF_T_MATCHES_OFF64_T] (ftello64): Define as weak alias of
	__ftello.
	* libio/iofread.c [weak_alias && !_IO_MTSAFE_IO]
	(__fread_unlocked): Define as strong alias of _IO_fread.  Use
	libc_hidden_def.
	(fread_unlocked): Don't use libc_hidden_ver.
	* libio/iofread_u.c (fread_unlocked): Rename to __fread_unlocked
	and define as weak alias of __fread_unlocked.  Don't use
	libc_hidden_def.
	(__fread_unlocked): Use libc_hidden_def.
	* include/stdio.h (__fileno): Declare.  Use libc_hidden_proto.
	(ftello): Don't use libc_hidden_proto.
	(__ftello): Declare.  Use libc_hidden_proto.
	(fread_unlocked): Don't use libc_hidden_proto.
	(__fread_unlocked): Declare.  Use libc_hidden_proto.
	* time/tzfile.c (__tzfile_read): Use __fileno, __fread_unlocked
	and __ftello instead of fileno, fread_unlocked and ftello.
2014-11-12 16:22:51 +00:00
Joseph Myers 2c46a66a3a Remove __libc_waitpid function name.
Continuing the removal of unused __libc_* function names, this patch
removes the __libc_waitpid name.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch; __waitpid, which is exported from
shared libc, changes from weak to strong on some configurations, which
is of no significance).

	* include/sys/wait.h (__libc_waitpid): Remove declaration.
	* posix/waitpid.c (__libc_waitpid): Rename to __waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/bsd/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (waitpid): Remove
	__libc_waitpid alias.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/syscalls.list (waitpid):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S (__libc_waitpid): Remove
	alias.
	* sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
2014-11-07 01:27:16 +00:00
Joseph Myers 9cf27b8d09 Remove INTDEF / INTUSE / INTVARDEF (bug 14132).
Completing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the final use - that for _dl_starting_up - replacing it
by rtld_hidden_def / rtld_hidden_proto.  Having removed the last use,
the mechanism itself is also removed.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.  (This is not much of a test since this
variable is only defined and used in the !HAVE_INLINED_SYSCALLS case.)

	[BZ #14132]
	* include/libc-symbols.h (INTUSE): Remove macro.
	(INTDEF): Likewise.
	(INTVARDEF): Likewise.
	(_INTVARDEF): Likewise.
	(INTDEF2): Likewise.
	(INTVARDEF2): Likewise.
	* elf/rtld.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Use
	rtld_hidden_def instead of INTVARDEF.
	* sysdeps/generic/ldsodefs.h [IS_IN_rtld]
	(_dl_starting_up_internal): Remove declaration.
	(_dl_starting_up): Use rtld_hidden_proto.
	* elf/dl-init.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Remove
	declaration.
	[!HAVE_INLINED_SYSCALLS] (_dl_starting_up_internal): Likewise.
	(_dl_init) [!HAVE_INLINED_SYSCALLS]: Don't use INTUSE with
	_dl_starting_up.
	* elf/dl-writev.h (_dl_writev): Likewise.
	* sysdeps/powerpc/powerpc64/dl-machine.h [!HAVE_INLINED_SYSCALLS]
	(DL_STARTING_UP_DEF): Use __GI__dl_starting_up instead of
	_dl_starting_up_internal.
2014-11-05 23:35:36 +00:00
Roland McGrath b4f6688462 Clean up internal ctype.h header. 2014-10-30 14:00:26 -07:00
Joseph Myers e19c95fd5e Remove __libc_readv and __libc_writev function names.
Continuing the removal of __libc_* function names that are no longer
used anywhere, this patch removes the __libc_readv and __libc_writev
names.

Tested for x86_64 that stripped installed shared libraries are
unchanged by the patch.

	* include/sys/uio.h (__libc_readv): Remove declaration.
	(__libc_writev): Likewise.
	* misc/readv.c (__libc_readv): Rename to __readv.
	(__readv): Do not define as alias.
	(readv): Define as alias of __readv.
	* misc/writev.c (__libc_writev): Rename to __writev.
	(__writev): Do not define as alias.
	(writev): Define as alias of __writev.
	* sysdeps/posix/readv.c (__libc_readv): Rename to __readv.
	(__readv): Do not define as alias.
	(readv): Define unconditionally as alias of __readv.
	* sysdeps/posix/writev.c (__libc_writev): Rename to __writev.
	(__writev): Do not define as alias.
	(writev): Define unconditionally as alias of __writev.
	* sysdeps/unix/syscalls.list (readv): Do not define __libc_readv
	name.
	(writev): Do not define __libc_writev name.
2014-10-30 20:56:34 +00:00
Joseph Myers d4e157aaae Remove __libc_creat function name.
glibc has lots of __libc_* function names that no longer serve any
purpose (are not used for any calls or exported at a public symbol
version).  This patch removes __libc_creat.  It has the effect of
creat becoming a strong symbol instead of a weak symbol in various
cases, but that's fine; in shared libraries it doesn't matter at all,
while for static linking the only other symbol sometimes defined in
the same object is creat64, and whenever creat64 is a reserved name so
is creat.

Other such cases of unnecessary __libc_* symbols are expected to be
dealt with in separate patches over time.

Tested for x86_64 (testsuite, and that the disassembly of installed
shared libraries is unchanged by the patch).

	* include/fcntl.h (__libc_creat): Remove declaration.
	* io/creat.c (__libc_creat): Rename to creat.
	(creat): Do not define as alias.
	* sysdeps/unix/sysv/linux/alpha/creat.c (creat64): Define as alias
	of creat instead of __libc_creat.
	* sysdeps/unix/sysv/linux/generic/creat.c (__libc_creat): Rename
	to creat.
	(creat): Do not define as alias.
	[__WORDSIZE == 64] (creat64): Define as alias of creat instead of
	__libc_creat.
	* sysdeps/unix/sysv/linux/syscalls.list (creat): Do not define
	__libc_creat name.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (creat):
	Likewise.
2014-10-30 19:44:31 +00:00
Joseph Myers 6bc6bd3b10 Don't use INTVARDEF/INTUSE with __libc_enable_secure (bug 14132).
Continuing the removal of the obsolete INTDEF / INTVARDEF / INTUSE
mechanism, this patch replaces its use for __libc_enable_secure with
the use of rtld_hidden_data_def and rtld_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* elf/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def
	instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* sysdeps/mach/hurd/dl-sysdep.c (__libc_enable_secure): Use
	rtld_hidden_data_def instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* elf/dl-deps.c (expand_dst): Likewise.
	* elf/dl-load.c (_dl_dst_count): Likewise.
	(_dl_dst_substitute): Likewise.
	(decompose_rpath): Likewise.
	(_dl_init_paths): Likewise.
	(open_path): Likewise.
	(_dl_map_object): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	(process_dl_audit): Likewise.
	(process_envvars): Likewise.
	* include/unistd.h [IS_IN_rtld] (__libc_enable_secure_internal):
	Remove declaration.
	(__libc_enable_secure): Use rtld_hidden_proto.
2014-10-10 11:13:11 +00:00
Joseph Myers cb8312455b Don't use INTDEF/INTUSE with __cxa_atexit (bug 14132).
This patch removes use of the obsolete INTDEF/INTUSE mechanism for
__cxa_atexit, replacing it with libc_hidden_def/libc_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* stdlib/cxa_atexit.c (__cxa_atexit): Use libc_hidden_def instead
	of INTDEF.
	* include/stdlib.h (__cxa_atexit_internal): Remove declaration.
	(__cxa_atexit): Use libc_hidden_proto.
	[!NOT_IN_libc] (__cxa_atexit): Remove macro definition.
2014-10-09 11:22:33 +00:00
Joseph Myers 5deeb19014 Remove stray *_internal aliases (bug 14132).
This patch removes some stray (unused) *_internal aliases, and
function prototypes with no corresponding definitions at all, at least
some of which were missed in previous INTDEF / INTUSE removal.

Not removed in this patch: __canonicalize_directory_name_internal,
noticed in the course of preparing this patch, isn't an alias, but an
actual function in sysdeps/mach/hurd/getcwd.c - apparently unused,
however.

Tested for x86_64 that installed stripped shared libraries are
unchanged by this patch.

	[BZ #14132]
	* include/wctype.h [!_ISOMAC] (__iswalpha_l_internal): Remove
	declaration.
	[!_ISOMAC] (__iswdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswspace_l_internal): Likewise.
	[!_ISOMAC] (__iswxdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswctype_internal): Likewise.
	* stdio-common/siglist.c (_sys_siglist_internal): Remove alias.
	* sysdeps/unix/syscalls.list (chown): Remove __chown_internal
	alias.
	(fcntl): Remove __fcntl_internal alias.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (connect): Remove
	__connect_internal alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (connect):
	Likewise.
2014-10-09 01:11:14 +00:00
Allan McRae b8079dd0d3 Update version.h and include/features.h for 2.20 release 2014-09-07 18:09:09 +10:00
Siddhesh Poyarekar eb72478a28 Remove unnecessary uses of NOT_IN_libc
If a IS_IN_* macro is defined, then NOT_IN_libc is always defined,
except obviously for IS_IN_libc.  There's no need to check for both.
Verified on x86_64 and i686 that the source is unchanged.

       * include/libc-symbols.h: Remove unnecessary check for
       NOT_IN_libc.
       * nptl/pthreadP.h: Likewise.
       * sysdeps/aarch64/setjmp.S: Likewise.
       * sysdeps/alpha/setjmp.S: Likewise.
       * sysdeps/arm/sysdep.h: Likewise.
       * sysdeps/i386/setjmp.S: Likewise.
       * sysdeps/m68k/setjmp.c: Likewise.
       * sysdeps/posix/getcwd.c: Likewise.
       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
       * sysdeps/s390/s390-32/setjmp.S: Likewise.
       * sysdeps/s390/s390-64/setjmp.S: Likewise.
       * sysdeps/sh/sh3/setjmp.S: Likewise.
       * sysdeps/sh/sh4/setjmp.S: Likewise.
       * sysdeps/unix/alpha/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
       * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
       * sysdeps/x86_64/setjmp.S: Likewise.
2014-08-21 10:26:46 +05:30
Siddhesh Poyarekar a476ac4b45 Fix -Wundef warnings in regex_internal.h 2014-08-01 14:30:43 +05:30
Siddhesh Poyarekar 3f3dd810e0 Fix -Wundef warnings in fnmatch.c
Fixes -Wundef warnings for MBSTATE_T and HAVE_STRING_H.  The
HAVE_STRING_H bit is a merge from the gnulib fnmatch.c and the
MBSTATE_T fix has been posted to gnulib for inclusion.
2014-08-01 14:23:38 +05:30
Roland McGrath 26ffd5e6c7 Clean up HAVE_CONFIG_H and STDC_HEADERS. 2014-06-20 20:04:47 -07:00
Joseph Myers 809fdf0d23 Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.
This patch cleans up for __ASSUME_ATFCTS now always being true for the
supported Linux kernel versions by removing conditional code in
sysdeps/unix/sysv/linux.  Several fchownat.c files that were only
present because of differences in the fallback syscalls used
(depending on the architecture-specific names of chown-related
syscalls for 32-bit uids) are removed.  Files that looks like they
could be replaced by syscalls.list entries have the standard "Consider
moving to syscalls.list." comment (see bug 14138) added.  Conditionals
on the relevant __NR_* syscall numbers being defined are also removed,
since my analysis indicated that the relevant syscalls are always
defined for all relevant kernel versions using any affected file.
Much of the removed fallback code had unbounded stack allocations, so
this reduces the number of cases to consider for anyone reviewing uses
of alloca and VLAs in glibc.

There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine
whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which
also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS
remains in kernel-features.h.  The logical condition relevant there is
whether openat64_not_cancel_3 is known to work.  Hurd doesn't use this
version of getcwd at all, so the conditionals in getcwd.c are always
true in glibc.  However, this code is also used in gnulib.  So the
best way to deal with the conditionals there may be for gnulib people
to deal with merging all relevant changes in both directions between
the glibc and gnulib versions of this file, at the end of which the
openat conditionals should be in whatever form is best for gnulib, and
hardcoded in the _LIBC case to having openat supported.

Tested by comparing before-and-after disassembly of installed
(stripped) shared libraries, on x86_64 and x86.  On x86 the patch made
no change to the disassembly; on x86_64, the only changes were in
readlinkat, where formerly the return value from the readlinkat
syscall was stored in an int variable before being converted to
ssize_t for the return, and now the return value is returned directly
without truncation to int.  I think it's clearly correct not to
truncate the return value (although I also think the truncation would
not have been a user-visible bug because the kernel would never have
returned a value it could have affected).

	* include/fcntl.h (__atfct_seterrno): Remove prototype.
	(__atfct_seterrno_2): Likewise.
	* sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include
	<kernel-features.h>.
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS]
	(__have_atfcts): Remove conditional definition.
	(__fxstatat([__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code
	unreachable if [__ASSUME_ATFCTS].
	* sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do
	not undefine and redefine.
	* sysdeps/unix/sysv/linux/faccessat.c: Do not include
	<kernel-features.h>.
	(faccessat) [__NR_faccessat]: Make code unconditional.
	(faccessat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchmodat.c: Do not include
	<kernel-features.h>.
	(fchmodat) [__NR_fchmodat]: Make code unconditional.
	(fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchownat.c: Do not include
	<kernel-features.h>.
	(fchownat) [__NR_fchownat]: Make code unconditional.
	(fchownat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/futimesat.c: Do not include
	<kernel-features.h>.
	(futimesat) [__NR_futimesat]: Make code unconditional.
	(futimesat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/linkat.c: Do not include
	<kernel-features.h>.
	(linkat) [__NR_linkat]: Make code unconditional.
	(linkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/mkdirat.c: Do not include
	<kernel-features.h>.
	(mkdirat) [__NR_mkdirat]: Make code unconditional.
	(mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/openat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function.
	[!__ASSUME_ATFCTS] (__have_atfcts): Remove variable.
	(OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional.
	(OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/readlinkat.c: Do not include
	<kernel-features.h>.
	(readlinkat) [__NR_readlinkat]: Make code unconditional.
	(readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.  Return
	result of INLINE_SYSCALL directly, not via int variable.
	* sysdeps/unix/sysv/linux/renameat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function.
	(renameat) [__NR_renameat]: Make code unconditional.
	(renameat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/symlinkat.c: Do not include
	<kernel-features.h>.
	(symlinkat) [__NR_symlinkat]: Make code unconditional.
	(symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/unlinkat.c: Do not include
	<kernel-features.h>.
	(unlinkat) [__NR_unlinkat]: Make code unconditional.
	(unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/xmknodat.c: Do not include
	<kernel-features.h>.
	(__xmknodat) [__NR_mknodat]: Make code unconditional.
	(__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
2014-06-20 15:41:35 +00:00
Roland McGrath 463dc947b4 Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Roland McGrath e0db65176f Clean up __exit_thread. 2014-05-13 09:49:20 -07:00
Roland McGrath 498a22333b Compile with -Wundef. 2014-03-14 11:32:51 -07:00
Carlos O'Donell ade40b10ff BZ #16632: Change [_BSD/_SVID]_SOURCE warning.
Source packages that need to support both 2.19 and
2.20 will need to decide to use _BSD_SOURCE and
_SVID_SOURCE vs. _DEFAULT_SOURCE.

The difficulty in making that decision is that
__GLIBC_MINOR__ is itself defined in features.h,
but you want to set the feature test macros before
including features.h.

Therefore to ease the transition we should disable
the warning if _DEFAULT_SOURCE is also defined.

https://sourceware.org/ml/libc-alpha/2014-02/msg00666.html

https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes
2014-02-25 13:23:25 -05:00
Andreas Schwab ab09bf616a Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Instead of trying to guess whether the second buffer needs to be freed
set a flag at the place it is allocated
2014-02-19 14:39:21 +01:00
Joseph Myers 498afc54df Combine __USE_BSD and __USE_SVID into __USE_MISC.
This patch cleans up following the obsoletion of _BSD_SOURCE and
_SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC.

The only non-mechanical part of this patch is the changes to
features.h; everything else is simple substitution of __USE_MISC for
the old macros.  Thus, this patch leaves obviously redundant
conditionals such as "defined __USE_MISC || defined __USE_MISC", and
does not update #endif comments where they referred to BSD or SVID in
words instead of the literal macro name.  This is intended to
facilitate patch review by separating the less mechanical changes from
these purely mechanical changes into a separate patch.  (I do intend
to integrate all the changes from
<https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I
believe includes all the trailing comment updates, in subsequent
patches.)

Tested x86_64.

	* include/features.h (__USE_BSD): Remove macro definitions.
	(__USE_SVID): Likewise.
	(_BSD_SOURCE): Likewise.
	(_SVID_SOURCE): Likewise.
	[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
	from definition of _DEFAULT_SOURCE.
	[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
	[_DEFAULT_SOURCE].
	* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
	* bits/mman.h [__USE_BSD]: Likewise.
	* bits/termios.h [__USE_BSD]: Likewise.
	* bits/waitstatus.h [__USE_BSD]: Likewise.
	* ctype/ctype.h [__USE_SVID]: Likewise.
	* dirent/dirent.h [__USE_BSD]: Likewise.
	* grp/grp.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* inet/netinet/igmp.h [__USE_BSD]: Likewise.
	* io/fcntl.h [__USE_BSD]: Likewise.
	* io/ftw.h [__USE_BSD]: Likewise.
	* io/sys/stat.h [__USE_BSD]: Likewise.
	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
	* libio/stdio.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* math/math.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
	* misc/bits/syslog.h [__USE_BSD]: Likewise.
	* misc/search.h [__USE_SVID]: Likewise.
	* misc/sys/mman.h [__USE_BSD]: Likewise.
	* misc/sys/syslog.h [__USE_BSD]: Likewise.
	* misc/sys/uio.h [__USE_BSD]: Likewise.
	* posix/bits/unistd.h [__USE_BSD]: Likewise.
	* posix/glob.h [__USE_BSD]: Likewise.
	* posix/regex.h [__USE_BSD]: Likewise.
	* posix/sys/types.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/sys/utsname.h [__USE_SVID]: Likewise.
	* posix/sys/wait.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/unistd.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* pwd/pwd.h [__USE_SVID]: Likewise.
	* resolv/netdb.h [__USE_BSD]: Likewise.
	* setjmp/setjmp.h [__USE_BSD]: Likewise.
	* signal/signal.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* socket/sys/socket.h [__USE_BSD]: Likewise.
	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
	* stdlib/stdlib.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string2.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string3.h [__USE_BSD]: Likewise.
	* string/endian.h [__USE_BSD]: Likewise.
	* string/string.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* string/strings.h [__USE_BSD]: Likewise.
	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
	* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
	* termios/termios.h [__USE_BSD]: Likewise.
	* time/sys/time.h [__USE_BSD]: Likewise.
	* time/time.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.

	* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
	condition to [__USE_MISC].
2014-02-12 23:41:01 +00:00
Joseph Myers c941736c92 Remove _BSD_SOURCE and _SVID_SOURCE.
This is a minimal patch to remove _BSD_SOURCE and _SVID_SOURCE from
the documented user API, making them into aliases for _DEFAULT_SOURCE
with a #warning given, but keeping most of the features.h logic using
those macros and all the exising __USE_* conditionals, on the basis
that all the consequent cleanups will go in followup patches.

Tested x86_64.

	* include/features.h: Update comment documenting feature test
	macros.
	[_BSD_SOURCE || _SVID_SOURCE]: Give #warning.  Define
	_DEFAULT_SOURCE.
	* manual/creature.texi (_BSD_SOURCE): Remove documentation.
	(_SVID_SOURCE): Likewise.
	(_DEFAULT_SOURCE): Update description of default features.
	(Feature Test Macros): Don't mention _SVID_SOURCE in conjunction
	with _GNU_SOURCE.
	* manual/filesys.texi (__ftw_func_t): Do not refer to _BSD_SOURCE.
	(S_ISVTX): Likewise.
	* manual/math.texi (Mathematical Constants): Likewise.
	* manual/signal.texi (Interrupted Primitives): Likewise.
	* manual/startup.texi (putenv): Do not refer to _SVID_SOURCE.
	* math/test-matherr.c (_SVID_SOURCE): Do not define.
	* sysvipc/sys/ipc.h [__USE_SVID && !__USE_XOPEN && __GNUC__ >= 2]:
	Don't refer to _SVID_SOURCE in warning text.
2014-02-11 23:40:07 +00:00
Will Newton b4f12ca391 include/stap-probe.h: Add comment about SystemTap argument format
Add a comment pointing to the SystemTap wiki page that documents the
format of the arguments. Also add a pointer to the SystemTap and
gdb sources which seem to be the best place to get the architecture
specific details.

ChangeLog:

2014-02-11  Will Newton  <will.newton@linaro.org>

	* include/stap-probe.h: Add comment about probe argument
	format.
2014-02-11 10:17:11 +00:00
Ondřej Bílka a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Roland McGrath 32749f6cd2 Avoid comma operator warnings. 2014-02-07 15:26:28 -08:00
Allan McRae 9a869d8220 Update version.h and include/features.h for 2.19 release 2014-02-07 19:04:38 +10:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers c688b41960 Add _DEFAULT_SOURCE feature test macro.
This patch adds a feature test macro _DEFAULT_SOURCE to enable the
default set of header declarations.

The intention is: if _DEFAULT_SOURCE is not used there is no change to
the set of __USE_* macros glibc defines; if it's used on its own, and
without compiler options such as -std=c99 that define __STRICT_ANSI__,
again, there is no change; if it's used together with the macros it
approximately (i.e., apart from __USE_POSIX_IMPLICITLY) implies
(-D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L), again, there
is no change.  Otherwise, it causes the relevant features to be
enabled, even if __STRICT_ANSI__, or another feature test macro, would
cause them to be disabled.

This macro deliberately bundles the POSIX.1-2008 (non-X/Open)
functionality with the BSD/SVID/"misc" functionality, rather than
defining a macro that gives just the latter, as many of the header
cleanups resulting from removing _BSD_SOURCE and _SVID_SOURCE support
are only possible when BSD/SVID/"misc" is always bundled with
POSIX.1-2008.

Tested x86_64.

	* include/features.h: Update comment documenting feature test
	macros.  Mention _DEFAULT_SOURCE in comment.
	[_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE,
	_BSD_SOURCE and _SVID_SOURCE.
	[!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE &&
	!_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE &&
	!_SVID_SOURCE]: Likewise.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(__USE_POSIX_IMPLICITLY): Define.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_C_SOURCE): Likewise.
	* manual/creature.texi (_DEFAULT_SOURCE): Document.
	(Feature Test Macros): Update documentation of default features.
2013-12-19 13:32:42 +00:00
Joseph Myers 7011c2622f Remove __FAVOR_BSD. 2013-12-17 18:05:57 +00:00
Siddhesh Poyarekar 520d437b94 [BZ #16195] Fix build warnings from systemtap probes in non-systemtap configurations
Joseph pointed out in the bug report (and in an earlier thread) that
systemtap probes cause build time warnings like the following:

    ../sysdeps/ieee754/dbl-64/e_atan2.c:602:4: warning: the address of
    'p' will always evaluate as 'true' [-Waddress]

due to the fact that we're now passing non-weak variables to
LIBC_PROBE in the libm probes.  This happens only on configurations
that do not enable systemtap.  The macro definition of LIBC_PROBE in
this case only acts as a sanity checker to ensure that the number
parameters passed to LIBC_PROBE is equal to the argument count
parameter passed before it.  This can be done in a much simpler manner
by just adding a macro definition for each number of arguments.  I am
assuming here that we don't really want to bother with supporting
LIBC_PROBE with an indeterminate number of arguments and if there is a
need for a probe to have more data than what is currently supported (4
arguments), one could simply add an additional macro here.
2013-12-03 12:26:12 +05:30
Joseph Myers 3c1c46a64a Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
Joseph Myers 699df45ba3 Define TLS version of libc_hidden_proto. 2013-11-18 23:02:55 +00:00
Joseph Myers 1484e65736 Define __STDC_IEC_559* based on __GCC_IEC_559*. 2013-11-04 15:43:57 +00:00
Andreas Schwab 5bb43a4319 Make __ffs hidden 2013-09-20 21:25:31 +02:00
Joseph Myers b92a20b560 conformtest: Fix namespace testing. 2013-09-04 20:47:21 +00:00
Joseph Myers 3f2e46a494 Remove --disable-versioning. 2013-09-04 15:25:42 +00:00
Roland McGrath 7f9d003410 Clean up h_errno declaration to use __thread unconditionally. 2013-08-27 11:09:33 -07:00
Roland McGrath fb431262c1 Clean up _res declaration to use __thread unconditionally. 2013-08-27 11:04:46 -07:00
David S. Miller eefa3be8e4 Update version.h and include/features.h for 2.18 release. 2013-08-10 15:52:55 -07:00
Mike Frysinger d605071ebf libc-internal.h: add ALIGN helper macros
Rather than open coding the masks, add helper macros to do the magic.
This makes code easier to read.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-06-24 20:25:15 -04:00
Adhemerval Zanella 85c2e6110c Fix loop construction to functions calls
Check wheter the compiler has the option -fno-tree-loop-distribute-patterns
to inhibit loop transformation to library calls and uses it on memset
and memmove default implementation to avoid recursive calls.
2013-06-20 19:42:05 -05:00
Siddhesh Poyarekar 2506109403 Set/restore rounding mode only when needed
The most common use case of math functions is with default rounding
mode, i.e. rounding to nearest.  Setting and restoring rounding mode
is an unnecessary overhead for this, so I've added support for a
context, which does the set/restore only if the FP status needs a
change.  The code is written such that only x86 uses these.  Other
architectures should be unaffected by it, but would definitely benefit
if the set/restore has as much overhead relative to the rest of the
code, as the x86 bits do.

Here's a summary of the performance improvement due to these
improvements; I've only mentioned functions that use the set/restore
and have benchmark inputs for x86_64:

Before:

cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy
exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy
pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy
sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy
tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy

After:

cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy
exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy
pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy
sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy
tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy

So the improvements are:

cos: 27.9089%
exp: 22.6919%
pow: 4.01564%
sin: 19.1585%
tan: 1.96086%

The downside of the change is that it will have an adverse performance
impact on non-default rounding modes, but I think the tradeoff is
justified.
2013-06-12 10:36:48 +05:30
Siddhesh Poyarekar 4eacded20f Fix indentation and add copyright header to time.h 2013-06-11 18:42:42 +05:30
Siddhesh Poyarekar 89fb683558 Fix symbol definitions for __clock_* functions
__clock_gettime and other __clock_* functions could result in an extra
PLT reference within libc.so if it actually gets used.  None of the
code currently uses them, which is why this probably went unnoticed.
2013-06-11 11:11:11 +05:30
Joseph Myers 2e09a79ada Avoid use of "register" as optimization hint. 2013-06-07 22:24:35 +00:00
Ondrej Bilka 350635a59a Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
Ryan S. Arnold e054f49430 Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
Thomas Schwinge 572676160d New <math.h> macro named issignaling to check for a signaling NaN (sNaN).
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-04-02 13:51:02 +02:00
Roland McGrath e57b0c6100 Avoid unconditional __call_tls_dtors calls in static linking. 2013-03-28 16:52:57 -07:00
Mike Frysinger 2f62b9ee0c sys/cdefs.h: export __attribute_alloc_size__
Since we want to use this in installed headers, move it to the installed
sys/cdefs.h.  This requires a slight tweaking of the name (add trailing
underscores).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-18 17:18:57 -05:00
Mike Frysinger 6ff444c418 unify xmalloc prototypes & friends
These prototypes are duplicated in many places.  Add a dedicated
header for holding prototypes for program-specific functions to
avoid that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-18 17:16:05 -05:00
Siddhesh Poyarekar ba384f6ed9 C++11 thread_local destructors support
This feature is specifically for the C++ compiler to offload calling
thread_local object destructors on thread program exit, to glibc.
This is to overcome the possible complication of destructors of
thread_local objects getting called after the DSO in which they're
defined is unloaded by the dynamic linker.  The DSO is marked as
'unloadable' if it has a constructed thread_local object and marked as
'unloadable' again when all the constructed thread_local objects
defined in it are destroyed.
2013-02-18 19:08:21 +05:30
Joseph Myers 70d9946a44 Remove __ptrvalue, __bounded and __unbounded. 2013-02-13 23:30:40 +00:00
Roland McGrath cd52592332 Remove redunant "warning: " prefix from stub warnings. 2013-02-12 16:15:59 -08:00
Roland McGrath f1d70dad53 Remove lots of inline keywords. 2013-02-07 14:44:18 -08:00
Andreas Schwab 903ae060db Don't use GLIBC_PRIVATE errno outside of libraries 2013-02-04 10:01:54 +01:00
Jan Kratochvil 542f94662e Improve link_map.l_addr comment. 2013-02-02 10:29:17 +01:00
Joseph Myers 728d7b43fc Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
Andreas Schwab cfa8054fbb Hide reference to mktemp in libpthread 2013-01-16 15:57:11 +01:00
Joseph Myers 6a57d93130 Remove __GLIBC_HAVE_LONG_LONG. 2013-01-11 21:13:25 +00:00
Joseph Myers 0c07e3eaa7 Remove __USE_ANSI. 2013-01-10 02:27:25 +00:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
David S. Miller c758a68615 Update version.h and include/features.h for 2.17 release. 2012-12-24 19:02:13 -08:00
Andreas Schwab 67cbf9a2a9 [BZ #14898]
* include/link.h (FORCED_DYNAMIC_TLS_OFFSET) [NO_TLS_OFFSET == 0]:
	Change to -1.
2012-12-07 14:55:19 -07:00
Siddhesh Poyarekar 1a538b9f15 * sunrpc/rpc/svc.h (__svc_accept_failed): Move declaration...
* include/rpc/svc.h: ... here.
2012-11-30 13:53:44 -07:00
H.J. Lu c515fb5148 Cast to __intptr_t before casting pointer to int64 2012-11-26 16:45:36 -08:00
H.J. Lu 7e1be74125 Check supported DF_1_XXX bits 2012-11-21 06:33:19 -08:00
Thomas Schwinge 123be9deda Add recvmmsg and sendmmsg to the generic glibc API. 2012-11-20 19:26:04 +01:00
Thomas Schwinge b830319d49 [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
Joseph Myers 5b5b04d628 Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
H.J. Lu f62c8abcfb Compile x86 rtld with -mno-sse -mno-mmx 2012-11-02 18:43:27 -07:00
Joseph Myers a68d0680f8 conformtest: Add test data for fenv.h. 2012-11-02 23:21:36 +00:00
Joseph Myers dcdae19a3f Test _ISOMAC in include/sys/syslog.h. 2012-11-02 15:41:37 +00:00
Roland McGrath 6e6249d0b4 BZ#14743: Move clock_* symbols from librt to libc. 2012-10-24 14:50:46 -07:00
Andreas Schwab ca38dc17d8 Avoid PLT references from __get_clockfreq on powerpc 2012-10-12 16:54:06 +02:00
H.J. Lu 11dd4af68c Framework to test IFUNC implementations on target 2012-10-11 16:40:01 -07:00
Roland McGrath 9043e2288e Name space hygeine for madvise. 2012-10-04 16:31:43 -07:00
Joseph Myers 6c9b0f6826 Make strtod respect the rounding mode (bug 14518). 2012-09-12 23:36:19 +00:00
Mike Frysinger 493387d21f add attribute_hidden to __have_{sock_cloexec,pipe2,dup3
These internal knobs are not exposed as part of the public ABI, so mark
them hidden to avoid generating relocations against them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-18 01:54:12 -04:00
Mike Frysinger a277af22ea split assume pipe2/dup3/sock_cloexec knobs
We can't assume sock_cloexec and pipe2 are bound together as the former
defines are found in glibc only while the latter are a combo of kernel
headers and glibc.  So if we do a runtime detection of SOCK_CLOEXEC, but
pipe2() is a stub inside of glibc, we hit a problem.  For example:

main()
{
	getgrnam("portage");
	if (!popen("ls", "r"))
		perror("popen()");
}

getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set
both __have_sock_cloexec and __have_pipe2 to true.  But if glibc was built
against older kernel headers where __NR_pipe2 does not exist, glibc will
have a ENOSYS stub for it.  So popen() will always fail as glibc assumes
pipe2() works.

While this isn't too much of an issue for some arches as they added the
functionality to the kernel at the same time, not all arches are that
lucky.

Since the code already has dedicated names for each feature, delete the
defines wiring these three features together and make each one a proper
dedicated knob.

We've been carrying this in Gentoo since glibc-2.9.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-18 00:35:47 -04:00
Roland McGrath e66a42f57f Split sys/param.h out into common file and sysdeps bits/param.h file. 2012-08-17 09:55:17 -07:00
Roland McGrath 67cc348d55 Declare __getdirentries in internal dirent.h. 2012-08-15 10:09:18 -07:00
Maxim Kuvyrkov 51a9ba860a Add explicit acquire/release semantics to atomic_exchange_and_add. 2012-08-13 19:31:00 -07:00
Marek Polacek b67e9372b2 Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
Roland McGrath 789bd351b4 Clean up stub accept4 definition. 2012-07-31 09:43:14 -07:00
Roland McGrath bea9b19322 Fix lots of bitrot for stub configurations. 2012-07-30 16:34:33 -07:00
Florian Weimer 84b3fd8407 Rename __secure_getenv to secure_getenv 2012-07-25 19:46:22 +02:00
Marek Polacek 7b8e0d49cb Get rid of ASM_GLOBAL_DIRECTIVE. 2012-07-10 14:30:24 +02:00
Carlos O'Donell 75f0d3040a Release 2.16
Update version.h and include/features.h for 2.16 release.
2012-06-30 12:12:34 -07:00
Andreas Schwab 0479b305c5 Fix invalid memory access in do_lookup_x.
[BZ #13579] Do not free l_initfini and allow it to be reused
on subsequent dl_open calls for the same library. This fixes
the invalid memory access in do_lookup_x when the previously
free'd l_initfini was accessed through l_searchlist when a
library had been opened for the second time.
2012-06-22 11:10:31 -07:00
Andreas Schwab 5be8418cb0 Remove use of INTDEF/INTUSE in stdio-common 2012-06-01 01:25:41 +02:00
Marek Polacek 3091725976 Remove use of INTUSE/INTDEF in misc. 2012-05-31 13:10:02 +02:00
Andreas Schwab 03277f8fe1 Remove use of INTDEF/INTUSE in socket 2012-05-31 00:34:41 +02:00
H.J. Lu 0ab0291b84 Convert WORDSIZE[32|64]/ld entries to abi-variants 2012-05-30 08:33:26 -07:00
Roland McGrath 3a097cc7a1 Add --enable-systemtap configuration to define static probe points. 2012-05-25 13:40:20 -07:00
Andreas Schwab 56d25bb888 Remove use of INTDEF/INTUSE in intl 2012-05-24 23:08:18 +02:00
Andreas Schwab d18ea0c5e6 Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
Roland McGrath d6c33fda03 Switch gettimeofday from INTUSE to libc_hidden_proto. 2012-05-24 13:12:34 -07:00
Andreas Jaeger 07c58f8f35 Fix sunrpc static library
* include/shlib-compat.h (libc_sunrpc_symbol): New macro.
	* sunrpc/svc_simple.c: Use it for registerrpc.
	* sunrpc/xcrypt.c: Use it for passwd2des.
2012-05-21 21:34:54 +02:00
Joseph Myers 4e124cedfb Update __STDC_ISO_10646__. 2012-05-16 18:49:30 +00:00
Thomas Schwinge 1792c087e5 Hurd: hidden_nolink macro for NO_HIDDEN case. 2012-05-10 15:57:26 -07:00
Thomas Schwinge 5aa3a74a59 Hurd: dup3 2012-05-10 15:57:23 -07:00
Thomas Schwinge eb43375f0f Hurd: accept4 2012-05-10 15:57:22 -07:00
Andreas Jaeger 021db4be6f Make sunrpc code usable again
New configure option --enable-obsolete-rpc makes the deprecated RPC
  headers and functions available at compile time as they were before
  version 2.14.  This option will be removed at some time in the future
  after the TI-RPC library becomes fully sufficient for the needs of
  existing applications.
2012-05-10 20:19:53 +02:00
Joseph Myers 6d74dd09d2 Define __STDC_NO_THREADS__. 2012-05-10 17:11:08 +00:00
Roland Mc Grath 05c2c9618f Warn if user requests __FORTIFY_SOURCE but it is disabled
[BZ #13979]
        * include/features.h: Warn if user requests __FORTIFY_SOURCE
        checking but the checks are disabled for any reason.
2012-05-08 19:44:57 +02:00
Marek Polacek 5ac3ea17df Fix attributes for fortify functions. 2012-04-29 15:34:20 +02:00
Petr Baudis 0396e69dbe Resolve __vector namespace conflict with Altivec. 2012-04-17 08:39:57 -05:00
H.J. Lu 81b035fe63 Replace Elf64_XXX with ElfW(XXX) in dl-irel.h 2012-03-22 10:17:05 -07:00
Richard Henderson 5f0a5daeee Move math/math_private.h to sysdeps/generic/math_private.h.
This reverts commit 60d6f5a6f5.
2012-03-09 16:12:17 -08:00
David S. Miller 60d6f5a6f5 Fix sparc build after recent math changes.
* include/math_private.h: New file.
2012-03-09 14:37:57 -08:00
Marek Polacek bc957d531c Remove oldish __GNUC_PREREQ. 2012-03-03 22:57:00 +01:00
Andreas Schwab 450bf206b4 Include <dirstream.h> before <dirent/dirent.h> 2012-02-28 15:02:02 +01:00
Ulrich Drepper d94a467080 Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
Ulrich Drepper 3134156779 First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
Joseph Myers ff3b3d8278 Move __STDC_* predefined macros from features.h to stdc-predef.h. 2012-02-22 12:53:04 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Chris Metcalf 463de86252 Use include/sys/epoll.h to provide libc_hidden_proto for epoll_pwait(). 2012-01-28 12:00:12 -05:00
Ulrich Drepper b15549e6f8 Fix gets problems 2012-01-24 17:40:44 -05:00
Ulrich Drepper ec09c1c410 Optimize xmalloc, xcalloc, xrealloc, and xstrdup
Add alloc_size attribute and apply consistently the malloc attribute
to xmalloc, xcalloc, xrealloc, and xstrdup.
2012-01-08 21:19:43 -05:00
Ulrich Drepper d9a216c037 Add checking versions of poll and ppoll 2012-01-08 11:55:32 -05:00
Ulrich Drepper a0da5fe1e4 More fallout from supporting only ELF 2012-01-08 00:45:01 -05:00
Ulrich Drepper a784e50247 Remove pre-ISO C support
No more __const.
2012-01-07 23:57:22 -05:00
Ulrich Drepper 0269750ca6 Remove non-ELF support 2012-01-07 20:30:26 -05:00
Ulrich Drepper c0e87cc018 Missed half the support for __USE_ISOC11 2012-01-01 07:17:21 -05:00
Ulrich Drepper 8fd8ff3bd8 Add __USE_ISOCXX11 2012-01-01 07:17:20 -05:00
Ulrich Drepper d78099052b Support C11 __STDC_SOURCE__ and _ISOC11_SOURCE 2012-01-01 07:17:19 -05:00
Ulrich Drepper c0da14cdda Preliminaries for 2.15 release 2011-12-23 14:03:55 -05:00
Roland McGrath 95b7042bac Fix __readlink declaration. 2011-11-11 10:04:54 -08:00
Andreas Schwab 647776f663 Account for alloca size rounding in extend_alloca 2011-11-01 18:29:34 +01:00
Ulrich Drepper 3a2c02424d Cache network interface information
Whenever getaddrinfo needed network interface information it used the
netlink interface to read the information every single time.  The
problem is that this information can change at any time.

The patch implements monitoring of the network interfaces through
nscd.  If no change is detected the previously read information can
be reused (which is the norm).  This timestamp information is also
made available to other processes using the shared memory segment
between nscd and those processes.
2011-10-31 01:51:16 -04:00
Ulrich Drepper fd5bdc0924 Optimize access to isXYZ and toXYZ tables
The functions to get the pointers can now depend on the TLS variable
be initialized.
2011-10-15 16:27:08 -04:00
Ulrich Drepper 7edb55ce06 Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
Andreas Schwab 3a62d00d40 Don't call ifunc functions in trace mode 2011-10-05 14:35:40 +02:00
Ulrich Drepper d063d16433 Remove support for !USE___THREAD 2011-09-10 16:50:28 -04:00
Ulrich Drepper 3ce1f29594 Cleanup of configuration options
Make several tool features mandatory and simplify the code.
2011-09-10 14:34:15 -04:00
Ulrich Drepper a0f33f996f Add range checking for FD_SET, FD_CLR, and FD_ISSET 2011-09-08 19:48:47 -04:00
Andreas Schwab 14d9678512 Clean up PLT use for scandirat 2011-08-11 11:41:09 -04:00
Ulrich Drepper c55fbd1ea7 Implement scandirat function 2011-08-09 09:57:55 -04:00
Ulrich Drepper 356f8bc660 2.14 release 2011-05-31 00:12:33 -04:00
Ulrich Drepper 34a9094f49 Don't unconditionally use alloca in gaih_inet 2011-05-20 23:46:03 -04:00
Ulrich Drepper 94b7cc3711 Fix a few problems in fopen and freopen
fopen should set the FD_CLOEXEC flag if requested evenif the kernel does
not support an aotmic operation.

freopen should reuse the file descriptor for the stream.  This is
especially important for calls to change the standard streams (stin,
stdout, stderr).
2011-05-15 15:28:46 -04:00
Ulrich Drepper f8a3b5bf8f Use mmap for allocation of buffers used for __abort_msg 2011-05-15 00:34:48 -04:00
Ulrich Drepper 6fb2dde3f1 Make complete getcwd work in rtld 2011-05-08 14:53:20 -04:00
Ulrich Drepper 7fb90fb89b Fix Linux getcwd for long paths
The getcwd syscall (so far?) can only handle path up to one page
in size.  There is no limit about directory hierarchy depth, though,
and the POSIX getcwd is supposed to handle this.  In that case fall
back to the generic getcwd.

Additionally, optimize the generic getcwd to use openat when possible
to change the asymptotic performance from O(N^2) to O(n).
2011-05-08 08:37:19 -04:00
Ulrich Drepper 28377d1bf5 Optimize fdopendir a bit.
Don't call fcntl(F_SETFD) unnecessarily.
2011-05-08 00:48:30 -04:00
Ulrich Drepper 7b57bfe598 Obsolete RPC implementation in libc. 2011-04-16 21:59:36 -04:00
Ulrich Drepper 81489b2ec3 Update comment about feature macros. 2011-04-02 08:25:30 -04:00
Ulrich Drepper 028478fa40 Fix copy relocations handling of unique objects. 2011-03-10 12:51:33 -05:00
Andreas Schwab 4bff6e0175 Fix memory leak in dlopen with RTLD_NOLOAD. 2011-02-25 20:49:48 -05:00
Ulrich Drepper 6392473fe9 2.13 release 2011-01-17 23:34:07 -05:00
Ulrich Drepper 8cf8ce1702 Clean up PLT use for getrlimit64. 2011-01-13 16:21:04 -05:00
Ulrich Drepper a85b5cb4d4 Fix PLT use due to __libc_alloca_cutoff. 2011-01-13 14:01:56 -05:00
Ulrich Drepper eaea92f137 Fix typo in comment. 2010-12-09 19:22:52 -05:00
Andreas Schwab 8e9f92e9d5 Require suid bit on audit objects in privileged programs 2010-10-24 21:43:15 -04:00
Jakub Jelinek 9ff8d36f27 Correct implementation of fmaf. 2010-10-11 09:27:05 -04:00
Ulrich Drepper 2f3e3dc75f Remove duplicate version of pmap_getport from NIS code. 2010-09-01 04:12:55 -07:00
Ulrich Drepper e28c88707e Prepare for release. 2010-05-03 14:11:14 -07:00
Ulrich Drepper b9ea2dd05e Fix handling of __need_mbstate_t and __need_wint_t.
Like the real header, the libc-internal wrapper for wchar.h needs to
undefine the macros so that if the header was already included before
the macros don't stay defined and cause problems later.
2010-03-27 06:06:35 -07:00
Ulrich Drepper c8727fa6e5 Fix Linux getlogin{_r,} implementation
The old implementation uses fd 0 to determine the login TTY.  This
was needed because using /dev/tty it is not possible to deduce the
login TTY.  For some time now there is the pseudo-file
/proc/self/loginuid which directly helps us to find the user.  Prefer
using this file.  It also works if stdin is closed, redirected, or
re-opened.
2010-03-24 17:02:57 -07:00
Ulrich Drepper 4ad43b62d6 Fix handling of STB_GNU_UNIQUE in LD_TRACE_PRELINKING 2010-03-24 10:14:22 -07:00
Andreas Schwab 7eb22e757e Avoid PLT call to fegetenv on s390 2010-02-09 22:34:17 -08:00
Ulrich Drepper 635bc2a20f Fix _XOPEN_SOURCE_EXTENDED handling. 2010-01-15 11:03:44 -08:00
Ulrich Drepper e531ede5af Fix up wchar.h for XPG7. 2010-01-11 20:07:47 -08:00
Ulrich Drepper f095bb7204 Add support for XPG7 testing.
The header conformance testing code needed extending for XPG7.  This
exposed a few bugs in the headers.  There are more changes to come.
2010-01-09 10:56:41 -08:00
Ulrich Drepper 63de5ef70a Fix isomac test after recent header change. 2009-12-23 19:31:50 -08:00
Ulrich Drepper 2af6396817 Avoid ELF lookup race.
On some architectures the update of the l_used field in the lookup
functions races with setting the other bits in the bitfield.  Simply
avoid this and optimize use of l_used in general.
2009-12-15 12:32:27 -08:00
Ulrich Drepper aa9890239a Optimize grantpt.
grantpt was performing two consecutive calls to stat with the same
file name.  Avoid this by creating a special version of the ptsname
function which allows to pass the stat result back to the caller.
2009-11-24 18:50:32 -08:00
Ulrich Drepper 7f9cd6ed20 2.11 release. 2009-10-30 10:17:08 -07:00
Ulrich Drepper 7f3146e789 Implement mkstemps and mkstemps64. 2009-10-30 00:11:07 -07:00
Andreas Schwab b7805d0ba8 Correct errno handling in expm1. 2009-10-19 21:23:15 -07:00
Andreas Schwab 5182cbc5ab Add hidden alias for fflush. 2009-09-01 15:31:09 -07:00
Ulrich Drepper 9a1d2d4555 Prepare use if IFUNC functions outside libc.so.
We use a callback function into libc.so to get access to the data
structure with the information and have special versions of the test
macros which automatically use this function.
2009-07-29 15:22:28 -07:00
Duncan Simpson 30a2dfd518 Make include/unistd.h suitable for C++ test cases. 2009-07-23 12:39:17 -07:00
Jakub Jelinek bea0ac1d87 Use rel semantics of cas instead of acq semantics with full barrier before it in _int_free
The following patch fixes catomic_compare_and_exchange_*_rel definitions
(which were never used and weren't correct) and uses
catomic_compare_and_exchange_val_rel in _int_free.  Comparing to the
pre-2009-07-02 --enable-experimental-malloc state the generated code should
be identical on all arches other than ppc/ppc64 and on ppc/ppc64 should use
lwsync instead of isync barrier.
2009-07-16 07:24:50 -07:00
Ulrich Drepper eba0994e75 Clean up code for hash table handling in ld.so. 2009-07-07 09:49:55 -07:00
Ulrich Drepper 48dcd0ba84 Preserve message printed before abort.
The terminal output etc is not visible in a core file.  The new
libc-internal variable __abort_msg will point to a string with the
message which has been printed before the abort in case abort is
called from inside libc.  BZ #10217
2009-06-15 16:17:09 -07:00
Ulrich Drepper 8275067de1 Add missing __execvpe prototype.
Avoids warnings.
2009-06-02 07:11:51 -07:00
Ulrich Drepper 7441470835 Finish IFUNC support for x86 and x86-64.
Add support for the IRELAIVE relocation and IFUNC in static executables.
2009-05-31 23:45:33 -07:00
Jakub Jelinek 3b1b533bc3 Avoid double definition of catomic_compare_and_exchange_val_acq. 2009-05-15 21:08:55 -07:00
Ulrich Drepper b50f8e42ba Check for valid stack frame in longjmp.
If longjmp restores the stack frame to an address which is beyond
the stack frame at the time of the longjmp call it would install
an uninitialized stack frame.  If compiled with _FORTIFY_SOURCE
defined, longjmp will now bail out in this situation.
2009-05-15 19:37:13 -07:00
Ulrich Drepper deb318c255 * version.h (VERSION): Bump for 2.10 release.
* include/features.h (__GLIBC_MINOR__): Bump to 10.
2009-05-09 17:40:57 +00:00
Ulrich Drepper c163ee23e0 * include/features.h: _POSIX_C_SOURCE >= 200112L implies C99. 2009-04-25 08:30:00 +00:00
Ulrich Drepper 829fea4617 [BZ #9955]
2009-04-23  Ulrich Drepper  <drepper@redhat.com>
	[BZ #9955]
	* gshadow/Makefile: New file.
	* gshadow/Versions: New file.
	* gshadow/fgetsgent.c: New file.
	* gshadow/fgetsgent_r.c: New file.
	* gshadow/getsgent.c: New file.
	* gshadow/getsgent_r.c: New file.
	* gshadow/getsgnam.c: New file.
	* gshadow/getsgnam_r.c: New file.
	* gshadow/gshadow.h: New file.
	* gshadow/putsgent.c: New file.
	* gshadow/sgetsgent.c: New file.
	* gshadow/sgetsgent_r.c: New file.
	* gshadow/tst-gshadow.c: New file.
	* include/gshadow.h: New file.
	* Makeconfig (all-subdirs): Add gshadow.
	* Makefile (installed-headers): Add gshadow/gshadow.h.
	* nss/Makefile (databases): Add sgrp.
	* nss/Versions: Add gshadow functions as private exports.
	* nss/nsswitch.conf: Add gshadow entry.
	* nss/sgrp-lookup.c: New file.
	* nss/nss_files/files-parse.c: Add STRING_LIST macro.  Rewrite
	parse_list to handle STRING_LIST and TRAILING_LIST_PARSER.
	* nss/nss_files/files-sgrp.c: New file.
	* sysdeps/generic/paths.h: Add _PATH_GSHADOW.
	* sysdeps/unix/sysv/linux/paths.h: Likewise.
2009-04-23 18:29:30 +00:00
Ulrich Drepper 3fb8a93ae9 Yet more changes to match sort function type change. 2009-03-17 00:35:38 +00:00
Ulrich Drepper 425ce2edb9 * config.h.in (USE_MULTIARCH): Define.
* configure.in: Handle --enable-multi-arch.
	* elf/dl-runtime.c (_dl_fixup): Handle STT_GNU_IFUNC.
	(_dl_fixup_profile): Likewise.
	* elf/do-lookup.c (dl_lookup_x): Likewise.
	* sysdeps/x86_64/dl-machine.h: Handle STT_GNU_IFUNC.
	* elf/elf.h (STT_GNU_IFUNC): Define.
	* include/libc-symbols.h (libc_ifunc): Define.
	* sysdeps/x86_64/cacheinfo.c: If USE_MULTIARCH is defined, use the
	framework in init-arch.h to get CPUID values.
	* sysdeps/x86_64/multiarch/Makefile: New file.
	* sysdeps/x86_64/multiarch/init-arch.c: New file.
	* sysdeps/x86_64/multiarch/init-arch.h: New file.
	* sysdeps/x86_64/multiarch/sched_cpucount.c: New file.

	* config.make.in (experimental-malloc): Define.
	* configure.in: Handle --enable-experimental-malloc.
	* malloc/Makefile: Handle experimental-malloc flag.
	* malloc/malloc.c: Implement PER_THREAD and ATOMIC_FASTBINS features.
	* malloc/arena.c: Likewise.
	* malloc/hooks.c: Likewise.
	* malloc/malloc.h: Define M_ARENA_TEST and M_ARENA_MAX.
2009-03-13 23:53:18 +00:00
Ulrich Drepper a99e59d771 * include/stdio.h (fmemopen): Add libc_hidden_proto.
* libio/fmemopen.c (fmemopen): Add libc_hidden_def.

	* elf/sprof.c: Avoid warning about multi-line comment.
2009-03-10 15:26:57 +00:00
Ulrich Drepper 3e6b0a28eb * include/features.h: Define macros for XPG7/POSIX 2008.
* sysdeps/unix/sysv/linux/bits/stat.h: Protect UTIME_NOW and
	UTIME_OMIT only with __USE_ATFILE.
	* sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise.
	* io/sys/stat.h: Move mknodat definition into same conditional as
	mknod.
	* time/sys/time.h: futimesat is not among the functions accepted
	into the POSIX standard.
2009-02-26 01:43:53 +00:00
Ulrich Drepper 2e6d6bacc2 * include/features.h: If no feature selection given and we select
by default a POSIX mode, also define __USE_POSIX_IMPLICITLY.
	* posix/Versions: Export __posix_getopt.
	* posix/getopt.c (_getopt_initialize): Take additional parameter.
	Use it to alternatively initialize __posixly_correct.
	(_getopt_internal_r): Take addition parameter.  Pass on to
	_getopt_initialize.
	(_getopt_internal): Take addition parameter.  Pass on to
	_getopt_internal_r.
	(getopt): Pass additional zero to _getopt_internal.
	(__posix_getopt): New function.
	* posix/getopt.h: Add redirection for getopt.
	* posix/getopt1.c (getopt_long): Pass additional zero to
	_getopt_internal.
	(getopt_long_only): Likewise.
	(_getopt_long_r): Pass additional zero to _getopt_internal_r.
	(_getopt_long_only_r): Likewise.
	* posix/getopt_int.h: Adjust declarations of _getopt_internal and
	_getopt_internal_r.
2009-02-26 01:22:06 +00:00
Ulrich Drepper 6c03cd11e9 * include/atomic.h: Define catomic_and if not already defined.
* sysdeps/x86_64/bits/atomic.h: Define catomic_and.
	* sysdeps/i386/i486/bits/atomic.h: Likewise.
2009-02-08 23:50:23 +00:00
Ulrich Drepper 78ac92ad8d * malloc/malloc.c (_int_free): Second argument is now mchunkptr.
Change all callers.
	(_int_realloc): Likewise.
	All _int_* functions are now static.
	* malloc/hooks.c: Change all callers to _int_free and _int_realloc.
	* malloc/arena.c: Likewise.
	* include/malloc.h: Remove now unnecessary declarations of the _int_*
	functions.
2009-02-07 22:01:49 +00:00
Ulrich Drepper 4f7408c7ac * include/rpc/auth.h: Use libc_hidden_proto for _null_auth.
* sunrpc/rpc_common.c: Add libc_hidden_def for _null_auth.  Also
	move _null_auth to .rodata.
2009-02-06 05:33:30 +00:00
Ulrich Drepper 647925b260 * sysdeps/i386/stackinfo.h (stackinfo_get_sp): Define.
(stackinfo_sub_sp): Define.
2009-01-29 15:36:26 +00:00
Ulrich Drepper fd537e535f [BZ #9750]
* nscd/mem.c (gc): Use alloca_count to get the real stack usage.
	* include/alloca.h (alloca_account): Define.
	* sysdeps/x86_64/stackinfo.h (stackinfo_get_sp): Define.
	(stackinfo_sub_sp): Define.
2009-01-29 00:17:57 +00:00