Commit Graph

37 Commits

Author SHA1 Message Date
Ulrich Drepper ddfd053577 * Makerules (sysd-rules): Define PTW for ptw-* files.
* Versions: Define GLIBC_2.7 for libc.
	* include/stdio.h: Declare __fortify_fail.
	* debug/fortify_fail.c: New file.
	* debug/Makefile (routines): Add fortify_fail.
	* debug/chk_fail.c: Use __fortify_fail.
	* debug/stack_chk_fail.c: Likewise.
	* io/Versions: Export __open_2, __open64_2, __openat_2, and
	__openat64_2 for GLIBC_2.7.
	* io/fcntl.h: When compiling with fortification, include bits/fcntl2.h.
	* io/open.c: Define *_2 variant of function which checks for O_CREAT
	and fails if necessary.
	* io/open64.c: Likewise.
	* io/openat.c: Likewise.
	* io/openat64.c: Likewise.
	* sysdeps/unix/sysv/linux/open64.c: Likewise.
	* sysdeps/unix/sysv/linux/openat.c: Likewise.
	* sysdeps/unix/sysv/linux/openat64.c: Likewise.
	* io/bits/fcntl2.h: New file.
	* include/fcntl.h: Declare __open_2, __open64_2, __openat_2, and
	__openat64_2.
	* include/bits/fcntl2.h: New file.
	* sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines):
	Add open_2.
	* sysdeps/unix/sysv/linux/open_2.c: New file.
2007-05-24 23:55:28 +00:00
Ulrich Drepper f50fa10c8a * malloc/memusage.sh (memusageso): Add quotes.
(memusagestat): Likewise.
	* debug/xtrace.sh (pcprofileso): Likewise.
	(pcprofiledump): Likewise.
	* debug/Makefile ($(objpfx)xtrace): Use $LIB in SLIBDIR
	replacement.
	* malloc/Makefile ($(objpfx)memusage): Likewise.
2006-05-19 16:48:27 +00:00
Ulrich Drepper a346370d58 * posix/bits/unistd.h (__readlinkat_chk): New prototype.
(__readlinkat_alias): New alias.
	(readlinkat): New inline function.
	* include/unistd.h (readlinkat): Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/readlinkat.c (readlinkat): Add
	libc_hidden_def.
	* io/readlinkat.c (readlinkat): Likewise.
	* debug/readlinkat_chk.c: New file.
	* debug/Makefile (routines): Add readlinkat_chk.
	* debug/Versions (libc): Export __readlinkat_chk@@GLIBC_2.5.
	* debug/tst-chk1.c (do_test): Add readlinkat tests.

	* nis/nss_nisplus/nisplus-netgrp.c: Cleanups.
	code is possible.  Move compatibility code in .text.compat section.
	over gaih array.  There is only one function to call in the moment.
2006-04-24 17:01:40 +00:00
Ulrich Drepper 02ca3541ce * debug/mbstowcs_chk.c: New file.
* debug/wcstombs_chk.c: New file.
	* debug/Makefile (routines): Add mbstowcs_chk and wcstombs_chk.
	* debug/Versions: Add __mbstowcs_chk and __wcstombs_chk.
	* stdlib/bits/stdlib.h: Add definitions for mbstowcs and wcstombs.

	* wcsmbs/bits/wchar2.h (mbsrtowcs): Pretty printing.

	* string/test-memset.c (test_main): Use negative byte value in
2005-07-25 21:41:45 +00:00
Ulrich Drepper df6f89692f * wcsmbs/bits/wchar2.h: Add definitions for wcrtomb, mbsrtowcs,
wcsrtombs, mbsnrtowcs, and wcsnrtombs.
	* debug/Makefile (routines): Add wcrtomb_chk, mbsrtowcs_chk,
	wcsrtombs_chk, mbsnrtowcs_chk, and wcsnrtombs_chk.
	* debug/Versions: Add __wcrtomb_chk, __mbsrtowcs_chk,
	__wcsrtombs_chk, __mbsnrtowcs_chk, and __wcsnrtombs_chk.
	* debug/tst-chk1.c: Add tests for new functions.
	* debug/mbsnrtowcs_chk.c: New file.
	* debug/mbsrtowcs_chk.c: New file.
	* debug/wcrtomb_chk.c: New file.
	* debug/wcsnrtombs_chk.c: New file.
	* debug/wcsrtombs_chk.c: New file.

	* include/stdio.h: Add declaration for __fxprintf.
2005-07-20 07:43:27 +00:00
Ulrich Drepper 9f3731cf7f * nscd/grpcache.c (cache_addgr): Use correct maximum for group ID
length.  Patch by Ivan Gyurdiev <ivg2@cornell.edu>.

	* debug/confstr_chk.c: New file.
	* debug/getdomainname_chk.c: New file.
	* debug/getgroups_chk.c: New file.
	* debug/gethostname_chk.c: New file.
	* debug/getlogin_r_chk.c: New file.
	* debug/ttyname_r_chk.c: New file.
	* posix/bits/unistd.h: Add definitions for new debug versions.
	* debug/tst-chk1.c: Add tests for new functions.
	* debug/Versions: Export new functions.
	* debug/Makefile (routines): Add new files.

	* stdlib/bits/stdlib.h: Fix typo.

	* manual/Makefile (libc/index.html): Depend on dir-add.texi.
2005-07-18 21:07:28 +00:00
Andreas Jaeger 5852d1e52d Update.
2005-07-15  Andreas Jaeger  <aj@suse.de>

	* debug/Makefile (tst-lfschk3-ENV): New, set locale.
	(tst-lfschk2-ENV): New.
	(tst-lfschk1-ENV): New.
	(tst-chk3-ENV): New.
	(tst-chk2-ENV): New.
	(tst-chk1-ENV): New.

	* include/stdlib.h: Remove malloc attribute from __posix_memalign.
	* stdlib/stdlib.h: Likewise.
2005-07-15 10:49:02 +00:00
Ulrich Drepper 8215c9ecf2 * wcsmbs/bits/wchar2.h: New file.
* include/bits/wchar2.h: New file.
	* wcsmbs/wchar.h: Include <bits/wchar2.h> if fortification is
	requested.
	* wcsmbs/wcsncpy.c: Add __wcsncpy alias.
	* string/bits/string3.h: Add fortified stpncpy definitions.
	* sysdeps/generic/stpncpy_chk.c: New file.
	* libio/vswprintf.c: Move _IO_wstrnfile definition to strfile.h.
	Export _IO_wstrn_jumps.
	* libio/strfile.h: Define _IO_wstrnfile and declare _IO_wstrn_jumps.
	* include/wchar.h: Declare __wcsncpy and __vswprintf_chk.
	* debug/fgetws_chk.c: New file.
	* debug/fgetws_u_chk.c: New file.
	* debug/fwprintf_chk.c: New file.
	* debug/swprintf_chk.c: New file.
	* debug/vfwprintf_chk.c: New file.
	* debug/vswprintf_chk.c: New file.
	* debug/vwprintf_chk.c: New file.
	* debug/wcpcpy_chk.c: New file.
	* debug/wcpncpy_chk.c: New file.
	* debug/wcscat_chk.c: New file.
	* debug/wcscpy_chk.c: New file.
	* debug/wcsncat_chk.c: New file.
	* debug/wcsncpy_chk.c: New file.
	* debug/wmemcpy_chk.c: New file.
	* debug/wmemmove_chk.c: New file.
	* debug/wmempcpy_chk.c: New file.
	* debug/wmemset_chk.c: New file.
	* debug/wprintf_chk.c: New file.
	* debug/tst-chk1.c: Add tests for new functions.
	* debug/Versions: Export new functions.
	* debug/Makefile (routines): Add new functions.
2005-07-15 10:32:45 +00:00
Ulrich Drepper b799f91ddd * stdlib/bits/stdlib.h: New file.
* stdlib/stdlib.h: Include <bits/stdlib.h> if fortification is
	requested.
	* Makefile (headers): Add bits/stdlib.h.
	* include/bits/stdlib.h: New file.
	* debug/Depend: New file.
	* debug/ptsname_r_chk.c: New file.
	* debug/realpath_chk.c: New file.
	* debug/wctomb_chk.c: New file.
	* debug/Makefile (routines): Add ptsname_r_chk, realpath_chk, and
	wctomb_chk.
	* debug/Versions: Export __ptsname_r_chk, __realpath_chk, and
	__wctomb_chk.
	* debug/tst-chk1.c: Add tests for __ptsname_r_chk, __realpath_chk, and
	__wctomb_chk.
2005-07-13 06:09:58 +00:00
Ulrich Drepper 35f1e82763 * Versions.def (ld): Add GLIBC_2.4.
* configure.in: Add --enable-stackguard-randomization option.
	(ENABLE_STACKGUARD_RANDOMIZE): New define.
	* config.h.in (ENABLE_STACKGUARD_RANDOMIZE): Add.
	* sysdeps/unix/sysv/linux/dl-osinfo.h: Include stdint.h.
	(_dl_setup_stack_chk_guard): New inline function.
	* sysdeps/generic/dl-osinfo.h: Include stdint.h.
	(_dl_setup_stack_chk_guard): New inline function.
	* elf/rtld.c (__stack_chk_guard): New variable.
	(dl_main): Remove all traces of TLS_INIT_TP_EXPENSIVE.
	Set __stack_chk_guard to _dl_setup_stack_chk_guard (),
	use THREAD_SET_STACK_GUARD if defined.
	* elf/Versions (ld): Export __stack_chk_guard@@GLIBC_2.4.
	* sysdeps/generic/libc-start.c (__stack_chk_guard): New variable.
	(__libc_start_main): Set __stack_chk_guard to
	_dl_setup_stack_chk_guard (), use THREAD_SET_STACK_GUARD if defined.
	* sysdeps/generic/libc-tls.c (__libc_setup_tls): Remove all
	traces of TLS_INIT_TP_EXPENSIVE.
	* debug/Versions (libc): Export __stack_chk_fail@@GLIBC_2.4.
	* debug/Makefile (routines): Add stack_chk_fail.
	(static-only-routines): Add stack_chk_fail_local.
	* debug/stack_chk_fail_local.c: New file.
	* debug/stack_chk_fail.c: New file.
	* elf/Makefile: Add rules to build and run tst-stackguard1{,-static}
	tests.
	* elf/tst-stackguard1.c: New file.
	* elf/tst-stackguard1-static.c: New file.
	* elf/stackguard-macros.h: New file.
2005-06-26 18:14:26 +00:00
Ulrich Drepper 65fb0d2189 * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t
instead of __off_t for last argument.
	* debug/Makefile (tests): Add tst-lfschk{1,2,3}.
	* debug/tst-lfschk1.c: New test.
	* debug/tst-lfschk2.c: New test.
	* debug/tst-lfschk3.c: New test.

2005-02-09  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/bits/termios.h (CMSPAR): Define.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Add __USE_MISC
	and __USE_XOPEN guards to match linux/bits/termios.h.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
	(CMSPAR): Define.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
2005-03-20 16:51:05 +00:00
Ulrich Drepper 61062f5630 * posix/bits/unistd.h: Avoid calling __*_chk variants if we can
determine the call will never trigger a failure.

	* sysdeps/i386/i686/memset_chk.S: Remove alias and warning.
	* sysdeps/x86_64/memset_chk.S: Likewise.

2005-02-24  Roland McGrath  <roland@redhat.com>

	* debug/Versions (libc: GLIBC_2.4): Remove
	__memset_zero_constant_len_parameter.
	* sysdeps/generic/memset_chk.c: Remove alias and warning.
	* misc/sys/cdefs.h (__warndecl): New macro.
	* debug/warning-nop.c: New file.
	* string/bits/string3.h (memset): Call __warn_memset_zero_len with no
	arguments, instead of calling __memset_zero_constant_len_parameter.
	Use __warndecl for __warn_memset_zero_len.
	* debug/Makefile (routines): Add $(static-only-routines).
	(static-only-routines): New variable.
2005-03-01 00:35:23 +00:00
Ulrich Drepper 553cc5f9ad * sysdeps/unix/sysv/linux/libc_fatal.c: Print backtrace and memory
map if requested.
	* debug/chk_fail.c: Request backtrace and memory map dump.

	* Versions.def: Add GLIBC_2.4 for libc.
	* debug/fgets_chk.c: New file.
	* debug/fgets_u_chk.c: New file.
	* debug/getcwd_chk.c: New file.
	* debug/getwd_chk.c: New file.
	* debug/readlink_chk.c: New file.
	* debug/read_chk.c: New file.
	* debug/pread_chk.c: New file.
	* debug/pread64_chk.c: New file.
	* debug/recv_chk.c: New file.
	* debug/recvfrom_chk.c: New file.
	* debug/Versions: Add all new functions with version GLIBC_2.4.
	* debug/Makefile (routines): Add fgets_chk, fgets_u_chk, read_chk,
	pread_chk, pread64_chk, recv_chk, recvfrom_chk, readlink_chk,
	getwd_chk, and getcwd_chk.  Plus appropriate CFLAGS definitions.
	* debug/tst-chk1.c: Add more tests.
	* libio/bits/stdio2.h: Add macros for fgets and fgets_unlocked.
	* include/stdio.h: Declare __fgets_chk and __fgets_unlocked_chk.
	* posix/unistd.h: Include <bits/unistd.h> for fortification.
	* posix/bits/unistd.h: New file.
	* posix/Makefile (headers): Add bits/unistd.h.
	* socket/sys/socket.h: Include <bits/socket2.h> for fortification.
	* socket/bits/socket2.h: New file.
	* socket/Makefile (headers): Add bits/socket2.h.

	* string/bits/string3.h: Extend memset macro to check for zero 3rd
	parameter and use __memset_zero_constant_len_parameter in that case.
	* sysdeps/generic/memset_chk.c: Add
	__memset_zero_constant_len_parameter alias and linker warning.
	* debug/Versions: Add __memset_zero_constant_len_parameter to libc
	with version GLIBC_2.4.

	* sysdeps/generic/bits/types.h: Don't unnecessarily use __extension__
	in __STD_TYPE definition.

2005-02-21  Jakub Jelinek  <jakub@redhat.com>

	* malloc/malloc.c (malloc_printerr): If MALLOC_CHECK_={5,7}, print
	the error message rather than program name.

2005-02-21  Ulrich Drepper  <drepper@redhat.com>
2005-02-21 23:14:10 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00
Ulrich Drepper 0325dd20dd Update.
2004-10-19  Jakub Jelinek  <jakub@redhat.com>

	* debug/Makefile (catchsegv): Prefix $LIB with a backslash.
2004-10-19 16:05:21 +00:00
Ulrich Drepper 08c6477a9c Update.
2004-10-19  Ulrich Drepper  <drepper@redhat.com>

	* debug/Makefile ($(objpfx)catchsegv): To support multilib
	platforms, use $LIB in path to slibdir.

2004-10-19  Jakub Jelinek  <jakub@redhat.com>

	* debug/catchsegv.sh: Update copyright year.
	Use mktemp to create segv_output file.
2004-10-19 10:36:18 +00:00
Ulrich Drepper b5cc329c4f 2004-10-15 Jakub Jelinek <jakub@redhat.com>
* elf/dl-minimal.c (__chk_fail): New.  Add rtld_hidden_def.
	* sysdeps/unix/sysv/linux/readonly-area.c: New file.
	* sysdeps/i386/i686/memmove.S (__memmove_chk): Add checking
	routine.
	* sysdeps/i386/i686/memcpy.S (__memcpy_chk): Likewise.
	* sysdeps/i386/i686/mempcpy.S (__mempcpy_chk): Likewise.
	* sysdeps/i386/i686/memset.S (__memset_chk): Likewise.
	* sysdeps/i386/i686/memmove-chk.S: New file.
	* sysdeps/i386/i686/memcpy-chk.S: Likewise.
	* sysdeps/i386/i686/mempcpy-chk.S: Likewise.
	* sysdeps/i386/i686/memset-chk.S: Likewise.
	* sysdeps/generic/strcat-chk.c (__strcat_chk): Don't __chk_fail
	if exactly fitting into buffer.
	* sysdeps/generic/strncat-chk.c (__strncat_chk): Likewise.
	* sysdeps/generic/readonly-area.c: New file.
	* sysdeps/generic/strncpy-chk.c (__strncpy_chk): Only test
	destlen once.
	* sysdeps/x86_64/memset.S (__memset_chk): Add checking routine.
	* sysdeps/x86_64/memcpy.S (__memcpy_chk): Likewise.
	* sysdeps/x86_64/mempcpy.S (__memcpy_chk): Define to __mempcpy_chk.
	* sysdeps/x86_64/memcpy-chk.S: New file.
	* sysdeps/x86_64/mempcpy-chk.S: Likewise.
	* sysdeps/x86_64/memset-chk.S: Likewise.
	* sysdeps/x86_64/strcpy-chk.S: Likewise.
	* sysdeps/x86_64/stpcpy-chk.S: Likewise.
	* argp/argp-xinl.c (__OPTIMIZE__): Define to 1 instead of nothing.
	* argp/argp-fs-xinl.c (__OPTIMIZE__): Likewise.
	* debug/tst-chk1.c: New test.
	* debug/tst-chk2.c: Likewise.
	* debug/tst-chk3.c: Likewise.
	* debug/test-strcpy_chk.c: Likewise.
	* debug/test-stpcpy_chk.c: Likewise.
	* debug/vsprintf_chk.c (__vsprintf_chk): If flags > 0, request
	_IO_FLAGS2_CHECK_PERCENT_N.  Add libc_hidden_def.
	* debug/Makefile (routines): Add printf_chk, fprintf_chk, vprintf_chk,
	vfprintf_chk, gets_chk and readonly-area.
	(CFLAGS-*_chk.c): Set.
	(tests): Add tst-chk1, tst-chk2, tst-chk3, test-strcpy_chk and
	test-stpcpy_chk.
	* debug/vprintf_chk.c: New file.
	* debug/printf_chk.c: Likewise.
	* debug/vfprintf_chk.c: Likewise.
	* debug/fprintf_chk.c: Likewise.
	* debug/gets_chk.c: Likewise.
	* debug/chk_fail.c (__chk_fail): Add libc_hidden_def.
	* debug/snprintf_chk.c (__snprintf_chk): Fix order of arguments
	passed to __vsnprintf_chk.
	* debug/Versions (libc): Export __printf_chk, __fprintf_chk,
	__vprintf_chk, __vfprintf_chk and __gets_chk @GLIBC_2.3.4.
	* debug/vsnprintf_chk.c (__vsnprintf_chk): Don't call
	__vsnprintf, instead create a temporary file with
	_IO_strn_jumps jumptable.  If flags > 0, request
	_IO_FLAGS2_CHECK_PERCENT_N.  Add libc_hidden_def.
	* libio/Makefile (headers): Add bits/stdio2.h.
	* libio/stdio.h: Include <bits/stdio2.h> if __USE_FORTIFY_LEVEL.
	(sprintf, snprintf, vsprintf, vsnprintf): Remove defines.
	* libio/strfile.h (_IO_strnfile): New type.
	(_IO_strn_jumps): New extern.
	* libio/vsnprintf.c (_IO_strnfile): Remove.
	(_IO_strn_jumps): Remove static.
	* libio/bits/stdio2.h: New file.
	* libio/vswprintf.c (_IO_strnfile): Rename type to...
	(_IO_wstrnfile): ...this.  Adjust all uses.
	* libio/libio.h (_IO_FLAGS2_CHECK_PERCENT_N): Define.
	* stdio-common/vfprintf.c (STR_LEN): Define.
	(vfprintf): Add readonly_format variable.
	Handle _IO_FLAGS2_CHECK_PERCENT_N.
	(buffered_vfprintf): Copy _flags2.
	* include/stdio.h (__sprintf_chk, __snprintf_chk, __vsprintf_chk,
	__vsnprintf_chk, __printf_chk, __fprintf_chk, __vprintf_chk,
	__vfprintf_chk): New prototypes.
	(__vsprintf_chk, __vsnprintf_chk): Add libc_hidden_proto.
	* include/string.h (__memcpy_chk, __memmove_chk, __mempcpy_chk,
	__memset_chk, __strcpy_chk, __stpcpy_chk, __strncpy_chk, __strcat_chk,
	__strncat_chk): New prototypes.
	* include/bits/string3.h: New file.
	* include/sys/cdefs.h (__chk_fail): Add libc_hidden_proto
	and rtld_hidden_proto.
	* string/Makefile (headers): Add bits/string3.h.
	* string/bits/string3.h (bcopy, bzero): New defines.
	(memset, memcpy, memmove, strcpy, strncpy, strcat, strncat): Change
	macros so that inlines are used only if unknown destination size
	or side-effects in destination argument.
	(mempcpy, stpcpy): Likewise.  Protect with #ifdef __USE_GNU.

2004-09-16  Ulrich Drepper  <drepper@redhat.com>

	* debug/Makefile (routines): Add *_chk.
	* debug/Versions (libc): Export __chk_fail, __memcpy_chk,
	__memmove_chk, __mempcpy_chk, __memset_chk, __stpcpy_chk,
	__strcat_chk, __strcpy_chk, __strncat_chk, __strncpy_chk,
	__sprintf_chk, __vsprintf_chk, __snprintf_chk, __vsnprintf_chk
	@GLIBC_2.3.4.
	* debug/chk_fail.c: New file.
	* debug/snprintf_chk.c: Likewise.
	* debug/sprintf_chk.c: Likewise.
	* debug/vsnprintf_chk.c: Likewise.
	* debug/vsprintf_chk.c: Likewise.
	* include/features.h (_FORTIFY_SOURCE): Document, handle.
	(__USE_FORTIFY_LEVEL): Define.
	(__GNUC_PREREQ): Move to earlier location.
	* include/sys/cdefs.h (__chk_fail): New prototype.
	* libio/bits/stdio.h (sprintf, vsprintf, snprintf, vsnprintf):
	Define if __USE_FORTIFY_LEVEL.
	* misc/sys/cdefs.h (__bos, __bos0): Define.
	* string/string.h: Include <bits/string3.h> if __USE_FORTIFY_LEVEL.
	* bits/string/string3.h: New header.
	* sysdeps/generic/memcpy_chk.c: New file.
	* sysdeps/generic/memmove_chk.c: Likewise.
	* sysdeps/generic/mempcpy_chk.c: Likewise.
	* sysdeps/generic/memset_chk.c: Likewise.
	* sysdeps/generic/stpcpy_chk.c: Likewise.
	* sysdeps/generic/strcat_chk.c: Likewise.
	* sysdeps/generic/strcpy_chk.c: Likewise.
	* sysdeps/generic/strncat_chk.c: Likewise.
	* sysdeps/generic/strncpy_chk.c: Likewise.
2004-10-15  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-minimal.c (__chk_fail): New.  Add rtld_hidden_def.
	* sysdeps/unix/sysv/linux/readonly-area.c: New file.
	* sysdeps/i386/i686/memmove.S (__memmove_chk): Add checking
	routine.
	* sysdeps/i386/i686/memcpy.S (__memcpy_chk): Likewise.
	* sysdeps/i386/i686/mempcpy.S (__mempcpy_chk): Likewise.
	* sysdeps/i386/i686/memset.S (__memset_chk): Likewise.
	* sysdeps/i386/i686/memmove-chk.S: New file.
	* sysdeps/i386/i686/memcpy-chk.S: Likewise.
	* sysdeps/i386/i686/mempcpy-chk.S: Likewise.
	* sysdeps/i386/i686/memset-chk.S: Likewise.
	* sysdeps/generic/strcat-chk.c (__strcat_chk): Don't __chk_fail
	if exactly fitting into buffer.
	* sysdeps/generic/strncat-chk.c (__strncat_chk): Likewise.
	* sysdeps/generic/readonly-area.c: New file.
	* sysdeps/generic/strncpy-chk.c (__strncpy_chk): Only test
	destlen once.
	* sysdeps/x86_64/memset.S (__memset_chk): Add checking routine.
	* sysdeps/x86_64/memcpy.S (__memcpy_chk): Likewise.
	* sysdeps/x86_64/mempcpy.S (__memcpy_chk): Define to __mempcpy_chk.
	* sysdeps/x86_64/memcpy-chk.S: New file.
	* sysdeps/x86_64/mempcpy-chk.S: Likewise.
	* sysdeps/x86_64/memset-chk.S: Likewise.
	* sysdeps/x86_64/strcpy-chk.S: Likewise.
	* sysdeps/x86_64/stpcpy-chk.S: Likewise.
	* argp/argp-xinl.c (__OPTIMIZE__): Define to 1 instead of nothing.
	* argp/argp-fs-xinl.c (__OPTIMIZE__): Likewise.
	* debug/tst-chk1.c: New test.
	* debug/tst-chk2.c: Likewise.
	* debug/tst-chk3.c: Likewise.
	* debug/test-strcpy_chk.c: Likewise.
	* debug/test-stpcpy_chk.c: Likewise.
	* debug/vsprintf_chk.c (__vsprintf_chk): If flags > 0, request
	_IO_FLAGS2_CHECK_PERCENT_N.  Add libc_hidden_def.
	* debug/Makefile (routines): Add printf_chk, fprintf_chk, vprintf_chk,
	vfprintf_chk, gets_chk and readonly-area.
	(CFLAGS-*_chk.c): Set.
	(tests): Add tst-chk1, tst-chk2, tst-chk3, test-strcpy_chk and
	test-stpcpy_chk.
	* debug/vprintf_chk.c: New file.
	* debug/printf_chk.c: Likewise.
	* debug/vfprintf_chk.c: Likewise.
	* debug/fprintf_chk.c: Likewise.
	* debug/gets_chk.c: Likewise.
	* debug/chk_fail.c (__chk_fail): Add libc_hidden_def.
	* debug/snprintf_chk.c (__snprintf_chk): Fix order of arguments
	passed to __vsnprintf_chk.
	* debug/Versions (libc): Export __printf_chk, __fprintf_chk,
	__vprintf_chk, __vfprintf_chk and __gets_chk @GLIBC_2.3.4.
	* debug/vsnprintf_chk.c (__vsnprintf_chk): Don't call
	__vsnprintf, instead create a temporary file with
	_IO_strn_jumps jumptable.  If flags > 0, request
	_IO_FLAGS2_CHECK_PERCENT_N.  Add libc_hidden_def.
	* libio/Makefile (headers): Add bits/stdio2.h.
	* libio/stdio.h: Include <bits/stdio2.h> if __USE_FORTIFY_LEVEL.
	(sprintf, snprintf, vsprintf, vsnprintf): Remove defines.
	* libio/strfile.h (_IO_strnfile): New type.
	(_IO_strn_jumps): New extern.
	* libio/vsnprintf.c (_IO_strnfile): Remove.
	(_IO_strn_jumps): Remove static.
	* libio/bits/stdio2.h: New file.
	* libio/vswprintf.c (_IO_strnfile): Rename type to...
	(_IO_wstrnfile): ...this.  Adjust all uses.
	* libio/libio.h (_IO_FLAGS2_CHECK_PERCENT_N): Define.
	* stdio-common/vfprintf.c (STR_LEN): Define.
	(vfprintf): Add readonly_format variable.
	Handle _IO_FLAGS2_CHECK_PERCENT_N.
	(buffered_vfprintf): Copy _flags2.
	* include/stdio.h (__sprintf_chk, __snprintf_chk, __vsprintf_chk,
	__vsnprintf_chk, __printf_chk, __fprintf_chk, __vprintf_chk,
	__vfprintf_chk): New prototypes.
	(__vsprintf_chk, __vsnprintf_chk): Add libc_hidden_proto.
	* include/string.h (__memcpy_chk, __memmove_chk, __mempcpy_chk,
	__memset_chk, __strcpy_chk, __stpcpy_chk, __strncpy_chk, __strcat_chk,
	__strncat_chk): New prototypes.
	* include/bits/string3.h: New file.
	* include/sys/cdefs.h (__chk_fail): Add libc_hidden_proto
	and rtld_hidden_proto.
	* string/Makefile (headers): Add bits/string3.h.
	* string/bits/string3.h (bcopy, bzero): New defines.
	(memset, memcpy, memmove, strcpy, strncpy, strcat, strncat): Change
	macros so that inlines are used only if unknown destination size
	or side-effects in destination argument.
	(mempcpy, stpcpy): Likewise.  Protect with #ifdef __USE_GNU.

2004-09-16  Ulrich Drepper  <drepper@redhat.com>

	* debug/Makefile (routines): Add *_chk.
	* debug/Versions (libc): Export __chk_fail, __memcpy_chk,
	__memmove_chk, __mempcpy_chk, __memset_chk, __stpcpy_chk,
	__strcat_chk, __strcpy_chk, __strncat_chk, __strncpy_chk,
	__sprintf_chk, __vsprintf_chk, __snprintf_chk, __vsnprintf_chk
	@GLIBC_2.3.4.
	* debug/chk_fail.c: New file.
	* debug/snprintf_chk.c: Likewise.
	* debug/sprintf_chk.c: Likewise.
	* debug/vsnprintf_chk.c: Likewise.
	* debug/vsprintf_chk.c: Likewise.
	* include/features.h (_FORTIFY_SOURCE): Document, handle.
	(__USE_FORTIFY_LEVEL): Define.
	(__GNUC_PREREQ): Move to earlier location.
	* include/sys/cdefs.h (__chk_fail): New prototype.
	* libio/bits/stdio.h (sprintf, vsprintf, snprintf, vsnprintf):
	Define if __USE_FORTIFY_LEVEL.
	* misc/sys/cdefs.h (__bos, __bos0): Define.
	* string/string.h: Include <bits/string3.h> if __USE_FORTIFY_LEVEL.
	* bits/string/string3.h: New header.
	* sysdeps/generic/memcpy_chk.c: New file.
	* sysdeps/generic/memmove_chk.c: Likewise.
	* sysdeps/generic/mempcpy_chk.c: Likewise.
	* sysdeps/generic/memset_chk.c: Likewise.
	* sysdeps/generic/stpcpy_chk.c: Likewise.
	* sysdeps/generic/strcat_chk.c: Likewise.
	* sysdeps/generic/strcpy_chk.c: Likewise.
	* sysdeps/generic/strncat_chk.c: Likewise.
	* sysdeps/generic/strncpy_chk.c: Likewise.
2004-10-18 04:17:19 +00:00
Ulrich Drepper 6c3ebebd1e Update.
2001-08-29  Ulrich Drepper  <drepper@redhat.com>

	* nis/nis_findserv.c (__nis_findfastest): Don't fail if reply received
	first is from a previous call.
	Patch by Alexander Belopolsky <alexb@rentec.com> for [PR libc/3670].

2001-08-29  Andreas Schwab  <schwab@suse.de>

	* sysdeps/ia64/fpu/libm-test-ulps: Updated.

2001-08-25  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* config.make.in (INSTALL_SCRIPT): Define.
	* Makeconfig (INSTALL_SCRIPT): Define.
	* Makerules (do-install-script): New macro to install scripts using
	INSTALL_SCRIPT.
	(install-bin-script): New rule to install scripts with
	do-install-script.
	(install-bin-script-nosubdir): New rule.
	(install-no-libc.a-nosubdir): Add install-bin-script-nosubdir.
	(distinfo-vars): Add $(install-bin-script).
	* Rules (others): Likewise.
	* Makefile (glibcbug): Install with install-bin-script.
	* debug/Makefile (xtrace): Likewise.
	(catchsegv): Likewise.
	* elf/Makefile (ldd): Likewise.
	* malloc/Makefile (mtrace): Likewise.
	* timezone/Makefile (tzselect): Likewise.

2001-08-29  H.J. Lu  <hjl@gnu.org>

	* sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Pass
	ELF_RTYPE_CLASS_PLT, instead of R_MIPS_REL32, to
	_dl_lookup_versioned_symbol () and _dl_lookup_symbol ().

	Add it to LDFLAGS.so, LDFLAGS-rtld, and +link.
2001-08-29 23:31:38 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
2001-07-06  Paul Eggert  <eggert@twinsun.com>

	* manual/argp.texi: Remove ignored LGPL copyright notice; it's
	not appropriate for documentation anyway.
	* manual/libc-texinfo.sh: "Library General Public License" ->
	"Lesser General Public License".

2001-07-06  Andreas Jaeger  <aj@suse.de>

	* All files under GPL/LGPL version 2: Place under LGPL version
	2.1.
2001-07-06 04:58:11 +00:00
Ulrich Drepper ad10cac8a4 Update.
2001-05-09  Michael Keezer  <mkeezer@redhat.com>

	* Makeconfig: Added AIX-ld support for DSO.
	* Makerules: Likewise.
	* dlfcn/Makefile (defaultmod1.so): Added libc_nonshared.
	(defaultmod2.so): Likewise.
	* debug/Makefile: Conditionalize use of elf/ld.so.
	* iconvdata/Makefile: Moved LDFLAG rpath/soname info into Makeconfig.

	* sysdeps/unix/sysv/aix/Makefile: Added dl-support.c and dl-error.c.
	* sysdeps/unix/sysv/aix/Makefile: Made (f/g)rsave(0/1) &
	(f/g)prrest(0/1) static only.
	* sysdeps/unix/sysv/aix/gettimeofday.c: Removed #if 0.
	* sysdeps/unix/sysv/aix/start.c: Define __dso_handle if not ELF but
	shared.
	* sysdeps/unix/sysv/aix/setitimer.c: New file.
	* sysdeps/unix/sysv/aix/sleep.c: New file.
	* sysdeps/unix/sysv/aix/usleep.c: New file.
	* sysdeps/unix/sysv/aix/dl-addr.c: New file.
	* sysdeps/unix/sysv/aix/dl-error.c: New file.
	* sysdeps/unix/sysv/aix/dl-support.c: New file.
	* sysdeps/unix/sysv/aix/powerpc/register-dump.h: New file.

	(BODY for TO_LOOP): Keep track of Unicode 3.1 language tag. I f "ja",
	prefer conversion to Japanese character sets.  If "zh", prefer
	conversion to GB2312. I f "ko", prefer conversion to KSC5601.  Small
2001-06-20 07:10:50 +00:00
Andreas Jaeger 3ebab9ee23 Update.
2001-05-07  Andreas Jaeger  <aj@suse.de>

	* debug/Makefile ($(objpfx)xtrace): Substitute @SLIBDIR@ instead
	of @LIBDIR@.

2001-05-04  H.J. Lu  <hjl@gnu.org>

	* malloc/Makefile ($(objpfx)memusage): Substitute @SLIBDIR@
	not @LIBDIR@.
2001-05-07 08:39:40 +00:00
Ulrich Drepper 639c324856 Update.
2001-03-18  Ulrich Drepper  <drepper@redhat.com>

	* Makerules (build-shlib): Remove unnecessary slashes introduced in
	last change.

	* configure.in: Test for -Bgroup option of linker.
	* config.make.in: Define have-Bgroup.

	* conform/data/unistd.h-data: Require gethostname.
	* posix/unistd.h: Make gethostname prototype available for
	__USE_XOPEN2K.

	* crypt/Makefile: When generating DSO link with libc_nonshared.a.
	* debug/Makefile: Likewise.
	* dlfcn/Makefile: Likewise.
	* hesiod/Makefile: Likewise.
	* iconvdata/extra-module.mk: Likewise.
	* locale/Makefile: Likewise.
	* login/Makefile: Likewise.
	* math/Makefile: Likewise.
	* nis/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* resolv/Makefile: Likewise.
	* rt/Makefile: Likewise.

	* posix/unistd.h (gethostname): Change type of second parameter
	back to size_t as per upcoming XPG6.
2001-03-18 21:34:58 +00:00
Ulrich Drepper 40c4c9b562 Update.
2000-07-01  Andreas Jaeger  <aj@suse.de>

	* intl/Makefile (generated-dirs): New.

	* elf/Makefile (generated): trusted-dirs.h is always generated,
	move out of build-shared condition.
	(generated): Merge the two entries for build-shared.

2000-07-01  Ulrich Drepper  <drepper@redhat.com>

	* debug/Makefile (distribute): Add xtrace.sh.
2000-07-01 15:41:36 +00:00
Ulrich Drepper 01cfd4b71f Update.
2000-01-05  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (distribute): Add frame.h.
2000-01-06 00:33:56 +00:00
Ulrich Drepper cd33623e19 Update.
1999-10-29  Andreas Jaeger  <aj@suse.de>

	* math/gen-libm-test.pl: New file to generate a table of
	libm-test-ulps values.

1999-10-29  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h: Expect
	struct sigcontext* object as second parameter for profil_counter.
	Patches by Jakub Jelinek <jakub@redhat.com>.

1999-10-29  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Handle reiserfs.
	* sysdeps/unix/sysv/linux/pathconf.c: Likewise.

	* sysdeps/unix/sysv/linux/linux_fsinfo.h: Add values for devpts,
	efs, qnx4 and reiser file systems.

1999-10-29  Andreas Jaeger  <aj@suse.de>

	* locale/Makefile (others): Set to localedef and locale for make
	clean.

	* debug/Makefile (generated): Add xtrace for make clean to work.

1999-10-29  Andreas Jaeger  <aj@suse.de>

	* stdlib/tst-strtod.c: Add two testcases for hexadecimal input.

1999-10-25  Andreas Jaeger  <aj@suse.de>

	* math/libm-test.inc: Added code to ignore the given max ulps.
	(print_max_error): Check for ignore_max_ulp.
	(check_float_internal): Likewise.
	(parse_opt): Parse --ignore-max-ulp.
	(main): Initialize ignore_max_ulp.
1999-10-29 17:38:14 +00:00
Ulrich Drepper 08920a506b Update.
* debug/Makefile: Fix rules to generate pcprofiledump.
1999-10-12 18:38:32 +00:00
Ulrich Drepper cab30d75a3 Update.
1999-10-07  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (install-bin): Add pcprofiledump and xtrace.
	Add rules for both programs.
	* debug/pcprofiledump.c: New file.
	* debug/xtrace.sh: New file.
	* debug/pcprofile.c: Allow creating output file.  Add magic signature
	to let reader recognize file format.
1999-10-07 07:25:16 +00:00
Ulrich Drepper 87843f1516 Update.
1999-08-08  Ulrich Drepper  <drepper@cygnus.com>

	* string/bits/string2.h: Mark void* operations as extensions.
	* sysdeps/i386/i486/bits/string.h: Likewise.

	* debug/Makefile (routines): Add noophooks.
	(extra-libs): Add libpcprofile.  Add rules to build libpcprofile.
	* debug/noophooks.c: New file.
	* debug/pcprofile.c: New file.
1999-08-08 22:20:38 +00:00
Andreas Schwab bfe1b52846 1999-03-19 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* debug/Makefile (install-bin): Install and build catchsegv only 
if build-shared == yes.  Reported by jussi@jlaako.pp.fi [PR 
libc/965].
1999-03-19  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* debug/Makefile (install-bin): Install and build catchsegv only
	if build-shared == yes.  Reported by jussi@jlaako.pp.fi [PR
	libc/965].
1999-03-20 17:07:46 +00:00
Ulrich Drepper ce85d65bae Update.
1998-10-19  Ulrich Drepper  <drepper@cygnus.com>

	* include/ldsodefs.h: New file.

	* iconv/gconv.c: Include ldsodefs.h, not elf/ldsodefs.h.
	Remove change to avoid using _CALL_DL_FCT.
	* iconv/gconv_db.c: Likewise.
	* iconv/gconv_dl.c: Likewise.
	* iconv/skeleton.c: Likewise, here for DL_CALL_FCT.
	* malloc/mtrace.c: Include ldsodefs.h, not elf/ldsodefs.h.
	* nss/nsswitch.c: Likewise.
	* nss/nsswitch.h: Likewise.

1998-10-19  Philip Blundell  <pb@nexus.co.uk>

	* sunrpc/Makefile (otherlibs): If static NSS is in use, set to the
	required libraries.
	* login/Makefile (otherlibs): Likewise.
	* nscd/Makefile (otherlibs): Likewise.
	* Makeconfig (link-libc) [! build_shared]: Add $(otherlibs).

	* debug/Makefile (install-bin): Only build catchsegv if using ELF.

	* inet/Makefile: Add -DSTATIC_NSS to CFLAGS.

1998-10-19  Philip Blundell  <pb@nexus.co.uk>

	* sysdeps/unix/sysv/linux/arm/syscalls.list: Added setfsgid
	and setfsuid.

1998-10-19  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* nscd/connections.c: Fix typos in comments and strings.

	* nscd/nscd.conf: Update according to recent changes to nscd.

	* nscd/cache.c (prune_cache): Remove wrong comment.

	copy_posix.mask for copy instruction.
1998-10-19 15:22:14 +00:00
Ulrich Drepper 052b6a6c94 Update.
1998-08-09  Geoff Keating  <geoffk@ozemail.com.au>

	* sysdeps/powerpc/Makefile [subdir=elf]: Add new files split out of
	dl-machine.h.
	* sysdeps/powerpc/dl-machine.c: New file.
	* sysdeps/powerpc/dl-machine.h: Move much stuff into separate
	files.  Revise ELF_PREFERRED_ADDRESS to take account of
	the new mapping information (fixes bug involving huge bloated
	web browser).  Set ELF_MACHINE_PLTREL_OVERLAP.
	* sysdeps/powerpc/dl-start.S: New file.

	* elf/dl-load.c (_dl_map_object_from_fd): Initialise l_map_start,
	l_map_end.
	* elf/do-rel.h: Call elf_machine_rel only once (to save space).
	* elf/dynamic-link.h: Allow PLT relocs to be in the middle of the
	others.  Call elf_dynamic_do_##reloc only once (to save even more
	space).
	* elf/link.h: Add new members l_map_start and l_map_end to keep
	track of the memory map.
	* elf/rtld.c (_dl_start): Initialise l_map_start for ld.so and
	the executable.

1998-09-01 11:53  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (catchsegv): We need not rewrite SOVER anymore.
	Reported by Andreas Jaeger.

	* posix/glob.h: Use __size_t instead of size_t in definitions and
	make sure this is defined.

	* manual/locale.texi: Almost complete rewrite.  Document more functions
1998-09-01 14:31:49 +00:00
Ulrich Drepper 0b49f866c5 (distribute): Add register-dump.h. 1998-08-28 09:22:39 +00:00
Ulrich Drepper 07435eb48c Update.
1998-07-17  Ulrich Drepper  <drepper@cygnus.com>

	* debug/catchsegv.sh: Fix several stupid bugs.

	* shlib-versions: Define version for libSegFault.
	* debug/Makefile: Replace shared lib version number while rewriting.

1998-07-17  Mark Kettenis  <kettenis@phys.uva.nl>

	* sysdeps/mach/hurd/dl-sysdep.c (__mmap): Add sanity check.
	Suggested by Roland McGrath.

1998-07-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* timezone/Makefile: Remove '-L (leapseconds)' for testdata
	generation to control environment.

1998-07-17 09:21  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h: Define SIG_HOLD.
	Patch by John Tobey <jtobey@banta-im.com>.

	* manual/llio.texi: Document readv/writev and mmap functions.
	Patch by Michael Deutschmann <michael@talamasca.wkpowerlink.com>.

1998-07-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/Makefile (texis): Depend on texis.awk.
	(nonexamples): Filter out add-on chapters.
	(chapters.% top-menu.%): Depend on libc-texinfo.sh.
	(stamp-summary): Depend on $(texis) except summary.texi.
	($(inst_infodir)/libc.info): Simplify command.
	* manual/libc-texinfo.sh: Cleaned up to use less temporary files.
	Fix the generation of the detailed node listing to make it
	complete again.
	* manual/math.texi: Fix signature of lgamma_r.
1998-07-17 12:36:43 +00:00
Ulrich Drepper 6ce7ab198a Update.
1998-07-16 23:06  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (distribute): Add sigcontextinfo.h.
	Add rules to generate and install catchsegv.
	* debug/catchsegv.sh: New file.
1998-07-16 23:08:48 +00:00
Ulrich Drepper 107f813141 Update.
1998-07-16 20:01  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (routines): Add backtracesymsfd.
	Add rules to generate libSegFault.
	* debug/Versions: Add __backtrace_symbols_fd and backtrace_symbols_fd.
	* debug/execinfo.h: Declare backtrace_symbols_fd.
	* sysdeps/generic/backtracesymsfd.c: New file.
	* sysdeps/generic/elf/backtracesymsfd.c: New file.
	* sysdeps/generic/segfault.c: New file.
	* sysdeps/generic/sigcontextinfo.h: New file.
	* sysdeps/unix/sysv/linux/i386/sigcontextinfo.h: New file.

	* sysdeps/generic/elf/backtracesyms.c: Remove unneeded +.
1998-07-16 20:08:44 +00:00
Ulrich Drepper 2de7874e55 Update.
1998-06-08 18:57  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig (subdirs): Add debug.
	* configure.in: Use sysdeps/generic/elf subdir if ELF platform.
	* libc.map: Add __backtrace, __backtrace_symbols, backtrace and
	backtrace_symbols.
	* sysdeps/generic/backtrace.c: New file.
	* sysdeps/generic/backtracesyms.c: New file.
	* sysdeps/generic/elf/backtracesyms.c: New file.
	* sysdeps/i386/backtrace.c: New file.
	* debug/Makefile: New file.
	* debug/backtrace-tst.c: New file.
	* debug/execinfo.h: New file.
1998-06-08 19:06:31 +00:00