summaryrefslogtreecommitdiff
path: root/elf
AgeCommit message (Collapse)Author
2005-07-182005-04-26 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #1081] * elf/dl-close.c: Include stddef.h. (_dl_close): If called recursively, just remember GC needs to be rerun and decrease l_direct_opencount. Avoid GC if l_direct_opencount decreased to 1. Rerun GC at the end if any destructor unloaded some additional libraries. * elf/Makefile: Add rules to build and run unload6 test. * elf/unload6.c: New test. * elf/unload6mod1.c: New file. * elf/unload6mod2.c: New file. * elf/unload6mod3.c: New file.
2005-04-062005-03-20 Alfred M. Szmidt <ams@gnu.org>Roland McGrath
* elf/dl-open.c (dl_open_worker): Fix typo.
2005-04-062005-03-08 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #821] * elf/Makefile: Add rules to build and run unload4 test. * elf/unload4.c: New file. * elf/unload4mod1.c: New file. * elf/unload4mod2.c: New file. * elf/unload4mod3.c: New file. * elf/unload4mod4.c: New file.
2005-04-062005-03-08 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #821] * elf/Makefile: Add rules to build and run unload5 test. * elf/unload5.c: New file.
2005-04-062005-03-19 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/Makefile: Add rules to build and run order2. * elf/order2.c: New file. * elf/order2mod1.c: New file. * elf/order2mod2.c: New file. * elf/order2mod3.c: New file. * elf/order2mod4.c: New file.
2005-04-062005-03-05 Roland McGrath <roland@redhat.com>Roland McGrath
[BZ #821] * elf/unload3mod4.c: Declare foo. * elf/testobj2.c: Include <stdio.h>.
2005-04-062005-03-18 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * include/link.h (struct link_map): Remove l_opencount. Add l_removed. Change type of l_idx to int. * elf/dl-close.c: Basically rewrite. Do not use l_opencount to determine whether a DSO has to be unloaded. Instead compute this in this function. * elf/dl-deps.c: No need to manipulate l_opencount anymore. * elf/dl-lookup.c: Likewise. * elf/rtld.c: Likewise * elf/dl-open.c: Likewise. Use l_init_called to determine whether object was just loaded. * elf/dl-fini.c: Bump l_direct_opencount instead of l_opencount. * elf/dl-load.c (_dl_map_object_from_fd): Do not recognize DSO which is about to be unloaded as a match. (_dl_map_object): Likewise. * elf/do-lookup.h (do_lookup_x): Do not look into DSO which is about to be unloaded. * elf/circleload1.c: Don't use l_opencount anymore. * elf/neededtest.c: Likewise. * elf/neededtest2.c: Likewise. * elf/neededtest3.c: Likewise. * elf/neededtest4.c: Likewise. * elf/unload.c: Likewise. * elf/unload2.c: Likewise. * elf/loadtest.c: Likewise.
2005-04-062005-03-19 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #821] * elf/dl-open.c (dl_open_worker): Print exact l_direct_opencount value, it has been incremented before. 2005-03-18 Ulrich Drepper <drepper@redhat.com> [BZ #821] * include/link.h (struct link_map): Remove l_opencount. Add l_removed. Change type of l_idx to int. * elf/dl-close.c: Basically rewrite. Do not use l_opencount to determine whether a DSO has to be unloaded. Instead compute this in this function. * elf/dl-deps.c: No need to manipulate l_opencount anymore. * elf/dl-lookup.c: Likewise. * elf/rtld.c: Likewise * elf/dl-open.c: Likewise. Use l_init_called to determine whether object was just loaded. * elf/dl-fini.c: Bump l_direct_opencount instead of l_opencount. * elf/dl-load.c (_dl_map_object_from_fd): Do not recognize DSO which is about to be unloaded as a match. (_dl_map_object): Likewise. * elf/do-lookup.h (do_lookup_x): Do not look into DSO which is about to be unloaded. * elf/circleload1.c: Don't use l_opencount anymore. * elf/neededtest.c: Likewise. * elf/neededtest2.c: Likewise. * elf/neededtest3.c: Likewise. * elf/neededtest4.c: Likewise. * elf/unload.c: Likewise. * elf/unload2.c: Likewise. * elf/loadtest.c: Likewise.
2005-04-062005-03-18 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/dl-fini.c (_dl_fini): Split sorting of the maps in separate function _dl_sort_fini. (_dl_sort_fini): New function. * sysdeps/generic/ldsodefs.h: Declare _dl_sort_fini. * elf/dl-close.c (_dl_close): Call _dl_sort_fini before running destructors to call them in the right order. [BZ #821] * include/link.h (struct link_map): Remove l_opencount. Add l_removed. Change type of l_idx to int. * elf/dl-close.c: Basically rewrite. Do not use l_opencount to determine whether a DSO has to be unloaded. Instead compute this in this function. * elf/dl-deps.c: No need to manipulate l_opencount anymore. * elf/dl-lookup.c: Likewise. * elf/rtld.c: Likewise * elf/dl-open.c: Likewise. Use l_init_called to determine whether object was just loaded. * elf/dl-fini.c: Bump l_direct_opencount instead of l_opencount. * elf/dl-load.c (_dl_map_object_from_fd): Do not recognize DSO which is about to be unloaded as a match. (_dl_map_object): Likewise. * elf/do-lookup.h (do_lookup_x): Do not look into DSO which is about to be unloaded. * elf/circleload1.c: Don't use l_opencount anymore. * elf/neededtest.c: Likewise. * elf/neededtest2.c: Likewise. * elf/neededtest3.c: Likewise. * elf/neededtest4.c: Likewise. * elf/unload.c: Likewise. * elf/unload2.c: Likewise. * elf/loadtest.c: Likewise.
2005-04-062005-03-19 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/Makefile: Add rules to build and run order2. * elf/order2.c: New file. * elf/order2mod1.c: New file. * elf/order2mod2.c: New file. * elf/order2mod3.c: New file. * elf/order2mod4.c: New file. 2005-03-08 Jakub Jelinek <jakub@redhat.com> [BZ #821] * elf/Makefile: Add rules to build and run unload5 test. * elf/unload5.c: New file. [BZ #821] * elf/Makefile: Add rules to build and run unload4 test. * elf/unload4.c: New file. * elf/unload4mod1.c: New file. * elf/unload4mod2.c: New file. * elf/unload4mod3.c: New file. * elf/unload4mod4.c: New file.
2005-04-062005-03-18 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * include/link.h (struct link_map): Remove l_opencount. Add l_removed. Change type of l_idx to int. * elf/dl-close.c: Basically rewrite. Do not use l_opencount to determine whether a DSO has to be unloaded. Instead compute this in this function. * elf/dl-deps.c: No need to manipulate l_opencount anymore. * elf/dl-lookup.c: Likewise. * elf/rtld.c: Likewise * elf/dl-open.c: Likewise. Use l_init_called to determine whether object was just loaded. * elf/dl-fini.c: Bump l_direct_opencount instead of l_opencount. * elf/dl-load.c (_dl_map_object_from_fd): Do not recognize DSO which is about to be unloaded as a match. (_dl_map_object): Likewise. * elf/do-lookup.h (do_lookup_x): Do not look into DSO which is about to be unloaded. * elf/circleload1.c: Don't use l_opencount anymore. * elf/neededtest.c: Likewise. * elf/neededtest2.c: Likewise. * elf/neededtest3.c: Likewise. * elf/neededtest4.c: Likewise. * elf/unload.c: Likewise. * elf/unload2.c: Likewise. * elf/loadtest.c: Likewise. [BZ #821] * elf/rtld.c: Preloading errors are now never fatal.
2005-04-062005-03-19 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/dl-lookup.c (add_dependency): Always search l_initfini if the list exists. 2005-03-18 Ulrich Drepper <drepper@redhat.com> [BZ #821] * include/link.h (struct link_map): Remove l_opencount. Add l_removed. Change type of l_idx to int. * elf/dl-close.c: Basically rewrite. Do not use l_opencount to determine whether a DSO has to be unloaded. Instead compute this in this function. * elf/dl-deps.c: No need to manipulate l_opencount anymore. * elf/dl-lookup.c: Likewise. * elf/rtld.c: Likewise * elf/dl-open.c: Likewise. Use l_init_called to determine whether object was just loaded. * elf/dl-fini.c: Bump l_direct_opencount instead of l_opencount. * elf/dl-load.c (_dl_map_object_from_fd): Do not recognize DSO which is about to be unloaded as a match. (_dl_map_object): Likewise. * elf/do-lookup.h (do_lookup_x): Do not look into DSO which is about to be unloaded. * elf/circleload1.c: Don't use l_opencount anymore. * elf/neededtest.c: Likewise. * elf/neededtest2.c: Likewise. * elf/neededtest3.c: Likewise. * elf/neededtest4.c: Likewise. * elf/unload.c: Likewise. * elf/unload2.c: Likewise. * elf/loadtest.c: Likewise.
2005-04-062005-03-03 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #821] * elf/Makefile: Add rules to build and run unload3 test. * elf/unload3.c: New test. * elf/unload3mod1.c: New file. * elf/unload3mod2.c: New file. * elf/unload3mod3.c: New file. * elf/unload3mod4.c: New file.
2005-04-062005-03-03 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/dl-close.c (_dl_close): Don't try to set up new searchpath if the loader is closed. Fixes unload3. * elf/tst-global1.c: New file. * elf/Makefile (tests): Add tst-global1. * elf/testobj2.c (p): New function. 2005-03-03 Jakub Jelinek <jakub@redhat.com> [BZ #821] * elf/Makefile: Add rules to build and run unload3 test. * elf/unload3.c: New test. * elf/unload3mod1.c: New file. * elf/unload3mod2.c: New file. * elf/unload3mod3.c: New file. * elf/unload3mod4.c: New file.
2005-04-062005-03-03 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #821] * elf/dl-close.c (_dl_close): Don't try to set up new searchpath if the loader is closed. Fixes unload3. * elf/tst-global1.c: New file. * elf/Makefile (tests): Add tst-global1. * elf/testobj2.c (p): New function.
2005-03-072005-03-01 Alfred M. Szmidt <ams@gnu.org>Roland McGrath
[BZ #777] * elf/dl-load.c (__stack_prot) [!PROT_GROWSUP && !PROT_GROWSDOWN]: Add missing initializer.
2005-02-262005-02-21 Alan Modra <amodra@bigpond.net.au>Roland McGrath
[BZ #719] * elf/dl-reloc.c (_dl_nothread_init_static_tls): Assert that dtv array index is within bounds. 2005-02-21 Ulrich Drepper <drepper@redhat.com> [BZ #719] * elf/dl-reloc.c (_dl_nothread_init_static_tls): Avoid using THREAD_DTV multiple times, this minimally reduces code size on some archs.
2005-02-162005-01-21 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #735] * elf/Makefile: Add rules to build and run tst-align2. * elf/tst-align2.c: New test. * elf/tst-alignmod2.c: New file. * sysdeps/powerpc/tst-stack-align.h: New file. * sysdeps/i386/dl-machine.h (RTLD_START): Align stack and clear frame pointer before calling _dl_init. * sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
2005-02-162005-02-07 Ulrich Drepper <drepper@redhat.com>Roland McGrath
* elf/dl-load.c (_dl_map_object_from_fd): Makre sure registers are set correctly.
2005-02-162005-01-07 Jakub Jelinek <jakub@redhat.com>Roland McGrath
[BZ #738] * elf/dl-load.c (open_path): If rtld_search_dirs is in RELRO segment, avoid writing to it if none of the standard search directories exist.
2005-02-162005-01-08 Jakub Jelinek <jakub@redhat.com>Roland McGrath
* elf/Makefile (generated): Add tst-pie1{,.out,.o}.
2005-02-162005-01-12 Ulrich Drepper <drepper@redhat.com>Roland McGrath
[BZ #728] * posix/getconf.c: Update copyright year. * nss/getent.c: Likewise. * nscd/nscd_nischeck.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c: Likewise. * elf/ldconfig.c: Likewise. * catgets/gencat.c: Likewise. * csu/version.c: Likewise. * elf/ldd.bash.in: Likewise. * elf/sprof.c (print_version): Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * nscd/nscd.c (print_version): Likewise. * debug/xtrace.sh: Likewise. * malloc/memusage.sh: Likewise. * malloc/mtrace.pl: Likewise. * debug/catchsegv.sh: Likewise.
2005-02-162005-01-05 Steven Munroe <sjmunroe@us.ibm.com>Roland McGrath
[BZ #729] * elf/rtld.c (dl_main) [NEED_DL_SYSINFO_DSO]: Insure l_map_end and l_text_end are set for a VDSO with a single PT_LOAD entry.
2004-12-12Update.Ulrich Drepper
2004-12-12 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Fix computation of mapping start. It must take the actual pagesize into account, not the alignment in the file.
2004-12-08* elf/ldd.bash.in: When set -o pipefail is available, use that forRoland McGrath
piping to cat; when not, don't use the pipe at all. Pipe to cat in all cases of running the executable. When direct running exits with code 5, retry running via ${RTLD}. * elf/rtld.c (process_envvars): If __libc_enable_secure and mode != normal, exit with exitcode 5.
2004-12-07Update.cvs/fedora-glibc-20041207T1331Ulrich Drepper
2004-12-01 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (process_envvars): Don't consider LD_SHOW_AUXV and LD_DYNAMIC_WEAK if __libc_enable_secure. If __libc_enable_secure, /etc/suid-debug doesn't exist and program will be actually run, turn off all debugging. * sysdeps/generic/unsecvars.h (UNSECURE_ENVVARS): Add LD_DEBUG, LD_DYNAMIC_WEAK and LD_SHOW_AUXV.
2004-11-13Update.Ulrich Drepper
2004-11-13 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (print_statistics): Avoid segfaults if not all namespaces are used. Fix computation of num_relative_relocations on RELA architectures other than IA-64 and Alpha. 2004-11-13 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (_int_free): Use munmap_chunk for handling mmaped memory.
2004-11-122004-11-12 Martin Schwidefsky <schwidefsky@de.ibm.com>Roland McGrath
* elf/elf.h: Add 20 bit relocations R_390_*20.
2004-11-06* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): DefineRoland McGrath
_dl_sysinfo_dso under [NEED_DL_SYSINFO_DSO] as well. * elf/rtld.c (dl_main): Set up GLRO(dl_sysinfo_dso) under [NEED_DL_SYSINFO_DSO] as well. * sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Always include AT_SYSINFO and AT_SYSINFO_EHDR in name table. (_dl_sysdep_start) [NEED_DL_SYSINFO_DSO]: Match AT_SYSINFO_EHDR. * elf/dl-support.c (_dl_sysinfo_dso): Define also under [NEED_DL_SYSINFO_DSO]. (_dl_aux_init) [NEED_DL_SYSINFO || NEED_DL_SYSINFO_DSO]: Match AT_SYSINFO_EHDR and set GL(dl_sysinfo_dso). 2004-11-05 Roland McGrath <roland@redhat.com>
2004-10-28Update.Ulrich Drepper
2004-10-28 Ulrich Drepper <drepper@redhat.com> * elf/dl-open.c (dl_open_worker): Remove reference to glibcbug script.
2004-10-28Update.Ulrich Drepper
2004-10-27 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object): Use cache_rpath to check for existing rpath in main executable, not explicit test.
2004-10-27Update.Ulrich Drepper
2004-10-27 Jakub Jelinek <jakub@redhat.com> * include/resolv.h (_res_opcodes): New extern. Add libresolv_hidden_proto. * resolv/res_debug.c (_res_opcodes): Remove. (__p_class_syms, __p_type_syms): Add libresolv_hidden_proto and libresolv_hidden_data_def. Remove attribute_hidden. * resolv/res_mkquery (_res_opcodes): Remove. * resolv/res_data.c (_res_opcodes): Remove attribute_hidden. Add libresolv_hidden_data_def. * elf/dl-open.c (_dl_open): Don't allow explicitly opening a DSO into an empty namespace.
2004-10-27Update.Ulrich Drepper
2004-10-27 Ulrich Drepper <drepper@redhat.com> * elf/dl-fini.c (_dl_fini): Fix search for map in maps array. Reverse order of namespaces. * elf/Makefile: Add rules to build and run tst-dlmopen3. * elf/tst-dlmopen3.c: New file. * elf/tst-dlmopen1mod.c: Add check whether constructor runs.
2004-10-23* elf/elf.h: Add R_MN10300_* relocation numbers.Roland McGrath
2004-10-19Update.Ulrich Drepper
2004-10-19 Ulrich Drepper <drepper@redhat.com> * elf/Versions [ld, GLIBC_PRIVATE]: Add _dl_debug_state. * elf/dl-debug.c (_dl_debug_state): Add rtld_hidden_def. * sysdeps/generic/ldsodefs.h (_dl_debug_state): Don't maek as hidden but use rtld_hidden_proto.
2004-10-19Update.Ulrich Drepper
* elf/dl-addr.c (_dl_addr): Don't look at STT_TLS symbols. Use DL_SYMBOL_ADDRESS to set dli_saddr.
2004-10-18(__libc_dlsym_private, __libc_register_dl_open_hook): New functions. ↵Ulrich Drepper
(__libc_dlopen_mode): Call __libc_register_dl_open_hook and __libc_register_dlfcn_hook.
2004-10-18(dl_open_worker): Avoid dereferencing map in statically linked code if there ↵Ulrich Drepper
might none be found.
2004-10-182004-10-15 Jakub Jelinek <jakub@redhat.com>Ulrich Drepper
* 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-14Update.Ulrich Drepper
2004-10-14 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (_dl_start): Fix one last dl_loaded. * elf/dl-load.c (_dl_map_object_from_fd): Avoid definition of label when it is not needed. * elf/dl-close.c (_dl_close): Typo: & -> &&.
2004-10-14[BZ #77]Ulrich Drepper
Update. Add support for namespaces in the dynamic linker. * dlfcn/Makefile (libdl-routines): Add dlmopen. * dlfcn/Versions [libdl, GLIBC_2.3.4]: Add dlmopen. * dlfcn/dlfcn.h: Define Lmid_t, LM_ID_BASE, and LM_ID_NEWLM. Declare dlmopen. Document RTLD_DI_LMID. * dlfcn/dlinfo.c: Handle RTLD_DI_LMID. * dlfcn/dlmopen.c: New file. * dlfcn/dlopen.c: Pass new parameter to _dl_open. * dlfcn/dlopenold.c: Likewise. * elf/dl-addr.c: Adjust for removal of GL(dl_loaded). * elf/dl-caller.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-conflict.c: Likewise. * elf/dl-debug.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-lookup.h: Likewise. * elf/rtld.c: Likewise. * sysdeps/unix/sysv/linux/i386/dl-librecon.h: Likewise. * elf/dl-depsc: Likewise. Add new parameter to _dl_map_object. * elf/dl-fini.c: Call destructors in all namespaces. * elf/dl-iteratephdr.c: Compute total nloaded. Adjust for removal of GL(dl_loaded). * elf/dl-libc.c: Pass new parameter to _dl_open. Adjust for removal of GL(dl_loaded). * elf/dl-load.c (_dl_map_object_from_fd): Don't load ld.so a second time. Reuse the one from the main namespace in all others. Pass new parameter to _dl_new_object. Adjust for removal of GL(dl_loaded). * elf/dl-object.c: Take new parameter. Use it to initialize l_ns. Adjust for removal of GL(dl_loaded). * elf/dl-open.c (_dl_open): Take new parameter. Adjust for removal of GL(dl_loaded). * elf/dl-support.c: Replace global _dl_loaded etc variables with _dl_ns variable. * include/dlfcn.h: Adjust prototype of _dl_open. Define __LM_ID_CALLER. * include/link.h: Add l_real, l_ns, and l_direct_opencount elements. * sysdeps/generic/dl-tls.c: Bump TLS_STATIC_SURPLUS. Since libc is using TLS we need memory appropriate to the number of namespaces. * sysdeps/generic/ldsodefs.h (struct rtld_global): Replace _dl_loaded, _dl_nloaded, _dl_global_scope, _dl_main_searchlist, and _dl_global_scope_alloc with _dl_ns element. Define DL_NNS. Adjust prototypes of _dl_map_object and member in rtld_global_ro. * malloc/malloc.c: Include <dlfcn.h>. * malloc/arena.c (ptmalloc_init): If libc is not in primary namespace, never use brk. * elf/Makefile: Add rules to build and run tst-dlmopen1 and tst-dlmopen2. * elf/tst-dlmopen1.c: New file. * elf/tst-dlmopen1mod.c: New file. * elf/tst-dlmopen2.c: New file. * elf/dl-close.c: Improve reference counting by tracking direct loads. * elf/dl-lookup.c (add_dependency): Likewise. * elf/dl-open.c (dl_open_worker): Likewise. * elf/rtld.c (dl_main): Likewise. 2004-09-09 GOTO Masanori <gotom@debian.or.jp> [BZ #77] * elf/dl-close.c: Count down l_opencount to check not only for l_reldeps, but also l_initfini. 2004-10-13 Ulrich Drepper <drepper@redhat.com>
2004-10-13Update.Ulrich Drepper
2004-10-13 Ulrich Drepper <drepper@redhat.com> * elf/dl-close.c (_dl_close): Update bug reporting instructions.
2004-10-11Update.Ulrich Drepper
* elf/tst-dlopenrpath.c (do_test): Enable code which was disabled for debugging.
2004-10-11Update.Ulrich Drepper
2004-10-11 Ulrich Drepper <drepper@redhat.com> * elf/dl-sym.c (do_sym): Avoid using global variable. * elf/dl-addr.c (_dl_addr): Really use match everywhere.
2004-10-11(_dl_addr): Really use match everwhere.Ulrich Drepper
2004-10-06Update.Ulrich Drepper
2004-10-05 Ulrich Drepper <drepper@redhat.com> * elf/rtld.c (dl_main): Use _dl_debug_printf instead of _dl_printf for prelink message.
2004-10-04Update.Ulrich Drepper
2004-10-04 Ulrich Drepper <drepper@redhat.com> * elf/rtld.c (dl_main): Only skip => output in ldd mode if both strings are identical.
2004-09-26[BZ #151]Ulrich Drepper
Update. * elf/readlib.c (process_file): Before complaining about too-short file, check that it potentially be an ELF file. Also complain about empty files. [BZ #151].
2004-09-26[BZ #384]Ulrich Drepper
Update. * elf/dl-support.c (_dl_non_dynamic_init): Fix cleaning of environment. [BZ #384]
2004-09-24* sysdeps/x86_64/dl-machine.h (elf_machine_rela_relative): Remove Andreas Jaeger
static, add always_inline attribute. (elf_machine_rela): Likewise. (elf_machine_lazy_rel): Likewise. * elf/dynamic-link.h (elf_get_dynamic_info): Make static dependend on !RESOLVE so that it's not defined in local scope. * locale/weight.h (findidx): Remove static, it's not supported anymore with GCC 4.0 in a block scope. * locale/weightwc.h (findidx): Likewise. * posix/regcomp.c (seek_collating_symbol_entry): Likewise. (lookup_collation_sequence_value): Likewise. (build_range_exp): Likewise. (build_collating_symbol): Likewise. * iconv/iconvconfig.c (write_output): Likewise. * elf/do-rel.h (elf_dynamic_do_rel): Likewise.