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-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-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.
_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-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-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-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: & -> &&.
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-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.
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-23 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/bits/dlfcn.h: Add RTLD_DEEPBIND.
* elf/dl-object.c (_dl_new_object): Add new parameter mode. If mode
has RTLD_DEEPBIND set add local searchlist before global scope.
* sysdeps/generic/ldsodefs.h (_dl_new_object): Adjust prototype.
* elf/rtld.c: Adjust callers of _dl_new_object.
* elf/dl-load.c: Likewise.
(_dl_map_object_from_fd): If RTLD_DEEPBIND is used, don't do anything
for DF_SYMBOLIC.
* elf/dl-open.c (dl_open_writer): Pass RTLD_DEEPBIND flag on to
_dl_map_object_deps.
* elf/tst-deep1.c: New file.
* elf/tst-deep1mod1.c: New file.
* elf/tst-deep1mod2.c: New file.
* elf/tst-deep1mod3.c: New file.
* elf/Makefile: Add rules to build and run new tests.
* elf/dl-deps.c: Pretty printing.
2004-09-20 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (_dl_map_object_from_fd): Add some error checking.
Reorder code slightly.
* elf/rtld.c (dl_main): No need to check whether l_info[DT_HASH]
is non-null, _dl_setup_hash will do that.
* sysdeps/unisx/sysv/linux/dl-execstack.c: Get protection flag
from memory.
* elf/dl-load.c (_dl_map_object_from_fd): Add PROT_EXEC flag to
__stack_flags.
2004-09-17 Ulrich Drepper <drepper@redhat.com>
* include/link.h (struct link_map): Add l_used element.
* sysdeps/generic/ldsodefs.h: Define DL_DEBUG_UNUSED.
* elf/rtld.c (process_dl_debug): Recognize unused.
(dl_main): When unused debug flag is set check for unused direct
dependencies.
When printing dependencies and SONAME starts with /, omit the SONAME =>
part.
* elf/dl-lookup.c (_dl_lookup_symbol_x): Mark object in which the
symbol has been found as used.
* elf/ldd.bash.in: Add -u option.
* sysdeps/posix/getaddrinfo.c (gaih_addrtuple): Change type of
addr to avoid casts.
(gethosts): Removed.
(gethosts2): Renamed to gethosts. Make it usable for family !=
AF_UNSPEC. Fix AI_V4MAPPED.
(gaih_inet): Remove use of old gethosts. Always use what used to be
gethosts2. If entry is found, try to use the same NSS module's
getcanonname_r function. Use gethostbyaddr for AI_CANONNAME only
if getcanonname_r was not available. Fix filtering of AI_V4MAPPED
addresses. Numerous cleanups.
* resolv/nss_dns/dns-canon.c: New file.
* resolv/Makefile (libnss_dns-routines): Add dns-canon.
* resolv/Versions (libnss_dns): Add _nss_dns_getcanonname_r.
* elf/Makefile: Add rules to build and run tst-dlopenrpath.
* elf/tst-dlopenrpath.c: New file.
* elf/tst-dlopenrpathmod.c: New file.
* intl/tst-gettext.sh: Adjust for change of de.po file to UTF-8.
2004-08-13 Ulrich Drepper <drepper@redhat.com>
* elf/sprof.c (read_symbols): When comparing aliases, prefer
strong over weak symbols if both don't start with '_'.
* malloc/malloc.c: Use strong_alias instead of weak_alias wherever
possible.
Update.
* elf/dl-load.c (_dl_map_object): If __RTLD_CALLMAP flag is set,
reset loader before the actual loading.
* elf/dl-open.c (dl_open_worker): If file name contains no path
element determine map of caller. Pass caller map in this case to
_dl_map_object. Set __RTLD_CALLMAP in mode.
* include/dlfcn.h (__RTLD_CALLMAP): Define. [BZ #116]
Patch by Greg Wolodkin <greg@mathworks.com>.
Update.
2004-07-15 Jakub Jelinek <jakub@redhat.com>
[BZ #262]
* sysdeps/i386/elf/start.S (_start): Use @GOT instead of @GOTOFF
for main.
* elf/Makefile: Add rules to build and run tst-pie1.
* elf/tst-pie1.c: New test.
* elf/tst-piemod1.c: New file.
2004-07-10 Ulrich Drepper <drepper@redhat.com>
* elf/ldconfig.c: Define PROCINFO_CLASS as static before including
ldsodefs.h.
* sysdeps/generic/ldsodefs.h: Only define PROCINFO_CLASS if it is not
already defined.
* sysdeps/i386/dl-procinfo.c: Define PROCINFO_CALLS only if not
already defined.
* elf/rtld.c (print_statistics): Mark with noinline attribute.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Mark with always_inline
attribute.
(elf_machine_rel_relative): Likewise.
* include/string.h: Add libc_hidden_proto for __strtok_r and
__strsep_g.
* sysdeps/generic/strsep.c: Add libc_hidden_def.
* sysdeps/generic/strtok_r.c: Likewise.
* sysdeps/i386/strtok_r.S: Add alias for internal symbol.
* sysdeps/i386/i686/strtok_r.S: Likewise.
* sysdeps/x86_64/strtok_r.S: Likewise.
2004-07-09 Alexandre Oliva <aoliva@redhat.com>
* inet/getnetgrent_r.c (internal_setnetgrent): Make it hidden
instead of internal-linkage, such that we can alias to it.
(internal_endnetgrent, internal_getnetgrent_r): Likewise.