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.
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.
* elf/rtld.c: Preloading errors are now never fatal.
2005-03-08 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile: Add rules to build and run unload5 test.
* elf/unload5.c: New file.
2005-03-08 Jakub Jelinek <jakub@redhat.com>
* 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.
(_dl_out_of_memory): Use rtld_hidden_proto.
* elf/dl-error.c (_dl_out_of_memory): Use rtld_hidden_data_def.
(_dl_signal_error): Don't use INTUSE on _dl_out_of_memory.
* elf/dl-open.c (_dl_open): Likewise.
* elf/dl-deps.c (_dl_map_object_deps): Likewise.
* sunrpc/des_impl.c (des_set_key): Make first argument unsigned char *.
* elf/dl-addr.c (_dl_addr): Add a cast.
* elf/unload3mod4.c: Declare foo.
* elf/testobj2.c: Include <stdio.h>.
* sysdeps/gnu/errlist.awk: Emit NERR macro for _sys_nerr_internal
value constant, and use it in the defn.
* sysdeps/gnu/errlist-compat.awk: Use NERR in array decl.
Use actual size for compat array decls.
* config.make.in (cc-mtune): New substituted variable.
* configure.in (libc_cv_cc_mtune): New test for -mtune= switch,
done only if libc_mtune_example is defined.
* configure: Regenerated.
* sysdeps/i386/configure.in (libc_mtune_example): Set it.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/Makefile (CFLAGS-initfini.s): Use $(cc-mtune).
2005-03-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #776]
* iconv/iconvconfig.c: Fix comment for the output file.
(write_output): Clear padding in header.
2005-03-03 Ulrich Drepper <drepper@redhat.com>
* 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.
2005-03-03 Jakub Jelinek <jakub@redhat.com>
* 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.
slotinfo array.
(__libc_setup_tls_): Initializer length of DTV based on array length.
* elf/dl-load.c: Revert last change.
* sysdeps/generic/dl-tls.c: Revert last change.
* elf/dl-reloc.c (_dl_nothread_init_static_tls): Assert that dtv
array index is within bounds.
* elf/dl-load.c: Do not allow PT_TLS in modules loaded in statically
linked code.
* sysdeps/generic/dl-tls.c [!SHARED]: Don't build _dl_next_tls_modid.
* elf/Makefile: Remove rules to build and run tst-tls9-static.
* intl/dcigettext.c (_nl_find_msg): Add a cast.
* nis/nis_clone_dir.c (nis_clone_directory): Use char * for ADDR.
* nis/nis_clone_obj.c (nis_clone_object): Likewise.
* nis/nis_clone_res.c (nis_clone_result): Likewise.
* resolv/nss_dns/dns-network.c (getanswer_r): Use const unsigned char *
for END_OF_MESSAGE and CP.
* resolv/res_send.c (send_dg): Add else branch for case impossible
unless `poll' is buggy.
* crypt/crypt_util.c (__setkey_r): Add a cast.
* locale/programs/linereader.c (get_toplvl_escape): Use size_t for
NBYTES, and unsigned char * for BYTES.
* locale/programs/charmap.c (charmap_new_char): Use size_t and
unsighed char * for NBYTES, BYTES parameters.
* sysdeps/generic/dl-hash.h (_dl_elf_hash): Take const char * argument
and cast it.
* sysdeps/i386/i686/dl-hash.h (_dl_elf_hash): Likewise.
* sunrpc/create_xid.c (_create_xid): Don't use unsigned long for RES.
* sunrpc/svcauth_des.c (_svcauth_des): Fix cast type.
* sunrpc/auth_des.c (authdes_create): Don't use u_char for PKEY_DATA.
(authdes_marshal): Don't use unsigned int for LEN.
* sunrpc/xdr.c (xdr_hyper): Don't use unsigned long for T2.
(xdr_u_hyper): Likewise.
(xdr_u_short): Don't use u_long for L.
* sunrpc/xdr_intXX_t.c (xdr_int64_t): Don't use uint32_t for T2.
* inet/rexec.c (rexec_af): Use socklen_t.
* sunrpc/key_call.c (getkeyserv_handle): Likewise.
* sunrpc/rtime.c (rtime): Likewise.
* resolv/res_send.c (send_vc, send_dg): Likewise.
* nis/nis_callback.c (__nis_create_callback): Likewise.
* sysdeps/generic/libc-start.c: Use unsigned int for nthreads ptr.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix type of ADDR local.
* libio/libio.h (_IO_BE): Add parenthesis around EXPR.
* intl/dcigettext.c (INTVARDEF, INTUSE): Macros removed.
(_nl_default_dirname): Use libc_hidden_data_def instead of INTVARDEF.
(libc_freeres_fn, DCIGETTEXT): Don't use INTUSE.
* intl/bindtextdom.c (INTUSE): Macro removed.
(_nl_default_dirname): Use libc_hidden_proto.
(set_binding_values): Don't use INTUSE.
* include/libintl.h (_libc_intl_domainname_internal): Decl removed.
(_libc_intl_domainname): Use libc_hidden_proto.
* posix/regex_internal.h (gettext): Remove INTUSE on it.
* locale/SYS_libc.c (_libc_intl_domainname): Use libc_hidden_data_def
rather than INTDEF.
* include/libintl.h (_): Don't use *_internal name.
* ctype/ctype-extn.c (__ctype_tolower, __ctype_toupper): Use int32_t,
not uint32_t.
* locale/lc-ctype.c (_nl_postload_ctype): Likewise for assignments.
* iconv/gconv_open.c (__gconv_open): Remove useless cast.
[BZ #721]
* sysdeps/i386/dl-machine.h (ELF_MACHINE_NO_RELA): Define this outside
of [RESOLVE_MAP].
* sysdeps/sh/dl-machine.h (ELF_MACHINE_NO_REL): Likewise.
* sysdeps/powerpc/powerpc32/dl-machine.h
(elf_machine_rel, elf_machine_rel_relative): Removed.
* sysdeps/powerpc/powerpc64/dl-machine.h
(elf_machine_rel, elf_machine_rel_relative): Removed.
2005-02-03 Alexandre Oliva <aoliva@redhat.com>
[BZ #721]
* elf/dynamic-link.h: Don't declare nested auto functions that are
not going to be defined.
2004-07-23 Jakub Jelinek <jakub@redhat.com>
[BZ #284]
* include/features.h (_POSIX_SOURCE, _POSIX_C_SOURCE): Define
if _XOPEN_SOURCE >= 500 even if __STRICT_ANSI__ is defined.
2005-02-16 Roland McGrath <roland@redhat.com>
__libc_message to kill GCC warning about noreturn function returning.
* elf/rtld.c (dlmain): If LD_TRACE_PRELINKING, clear l_relocated flag
before relocating ld.so again.
* elf/rtld.c (_dl_start): Set bootstrap_map.l_relocated even
for already prelinked ld.so.
2005-01-21 Jakub Jelinek <jakub@redhat.com>
* 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.
ID if groupname starts with + or -.
* pwd/putpwent.c (putpwent): Don't write 0 as user or
group ID if user name starts with + or -.
2005-01-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/generic/ldsodefs.h (struct audit_ifaces): Add sh variants.
* sysdeps/elf/tst-auditmod1.c: Add sh support.
* sysdeps/sh/bits/link.h: New.
* sysdeps/sh/dl-machine.h: Remove trampoline code here. Define
ARCH_LA_PLTENTER and ARCH_LA_PLTEXIT. Remove obsolete comments.
(RTLD_START): Define __fpscr_values.
* sysdeps/sh/dl-trampoline.S: New file.
* sysdeps/sh/sh4/dl-trampoline.S: New file.
* sysdeps/sh/sh4/Versions [ld]: Add __fpscr_values.
* sysdeps/sh/sh4/dl-machine.h: Remove.
2005-01-10 Jakub Jelinek <jakub@redhat.com>
* time/tst-strptime.c (day_tests): Add 2 new tests.
(test_tm, main): Issue an error instead of segfaulting if
strptime returns NULL.
2005-01-10 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/alpha/libc-tls.c (__tls_get_addr): Updated for dtv_t union.
* sysdeps/ia64/libc-tls.c (__tls_get_addr): Likewise.
entry for static tls deallocation fix.
* sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
also contains information whether the memory pointed to is static
TLS or not, include <stdbool.h>.
* sysdeps/i386/tls.h: Likewise.
* sysdeps/ia64/tls.h: Likewise.
* sysdeps/powerpc/tls.h: Likewise.
* sysdeps/s390/tls.h: Likewise.
* sysdeps/sh/tls.h: Likewise.
* sysdeps/sparc/tls.h: Likewise.
* sysdeps/x86_64/tls.h: Likewise.
2005-01-09 Ulrich Drepper <drepper@redhat.com>
* elf/dl-debug.c (_dl_debug_initialize): Take extra parameter and
use it to select the r_debug structure for that namespace.
* elf/dl-close.c (_dl_close): Adjust call to _dl_debug_initialize.
* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
* elf/dl-open.c (_dl_open): Likewise.
* elf/rtld.c (dl_main): Likewise.
* sysdeps/generic/ldsodefs.h (struct link_namespaces): Add _ns_debug
member.
(_dl_debug_initialize): Add new parameter in declaration.
* elf/dl-close.c (_dl_close): Make sure auditing callbacks are not
called for the auditing objects themselves.
* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
2005-01-05 Steven Munroe <sjmunroe@us.ibm.com>
* 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.
2005-01-03 Andreas Jaeger <aj@suse.de>
* csu/Makefile (generated): Add start.os and start.ob.
* elf/Makefile (tests): Change rule for tst-pie1 so that make
clean works.
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.
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.
2004-07-05 Ulrich Drepper <drepper@redhat.com>
* elf/dl-init.c: Don't define and use _dl_starting_up if
HAVE_INLINED_SYSCALLS is defined and the variable is not used.
* elf/dl-support.c: Likewise.
* elf/rtld.c: Likewise.
* elf/dl-misc.c (_dl_debug_vdprintf): Use writev syscall directly
if HAVE_INLINED_SYSCALLS is defined.
* sysdeps/powerpc/powerpc64/dl-machine.h: Don't rest _dl_starting_up
here.
* sysdeps/powerpc/powerpc32/dl-start.S: Likewise.
* sysdeps/unix/sysv/linux/configure.in: Define HAVE_INLINED_SYSCALLS.
* config.h.in: Add entry for HAVE_INLINED_SYSCALLS.
* sysdeps/posix/profil.c: If compiled for ld.so, omit code which
is needed to stop profiling.
* elf/dl-open.c (dl_open_worker): If a newly opened object is to be
profile make sure it cannot be unloaded.
* sysdeps/unix/sysv/linux/dl-origin.c: Inline readlink syscall.
* sysdeps/unix/sysv/linux/fcntl.c: If compiled without cancellation
support, make sure the helper function is inlined.
* sysdeps/unix/sysv/linux/pread.c: Likewise.
* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c: Likewise.
2004-06-08 Jakub Jelinek <jakub@redhat.com>
[BZ #199]
* crypt/md5-crypt.c (__md5_crypt): Only update buflen if realloc
succeeds. Reported by Miles Ohlrich <miles@cray.com>.
* elf/chroot_canon.c (chroot_canon): Avoid segfault if first malloc
fails. Avoid memory leak if realloc fails.
2004-05-07 Dmitry V. Levin <ldv@altlinux.org>
* argp/argp-help.c (__argp_error, __argp_failure): Check result
of __asprintf call and don't use string if it failed.
* stdio-common/psignal.c (psignal): Likewise.
* locale/programs/localedef.c (more_help): Likewise.
* resolv/res_hconf.c (arg_service_list, arg_trimdomain_list,
arg_bool, parse_line): Check result of __asprintf calls and
don't use string if they failed.
* sunrpc/svc_simple.c (registerrpc, universal): Likewise.
* elf/ldconfig.c (parse_conf_include): Check result of __asprintf
call and exit if it failed.
2004-05-25 Ulrich Drepper <drepper@redhat.com>
* nss/digits_dots.c (__nss_hostname_digits_dots): Remove typep and
flags parameter, convert afp to simple int parameter. Adjust code.
typep was never != NULL and flags therefore also unused. *afp is
never modified.
* nss/nsswitch.h: Adjust __nss_hostname_digits_dots prototype.
* nss/getXXbyYY.c: Remove HAVE_TYPE handling. Adjust af parameter
handling for __nss_hostname_digits_dots calls.
* nss/getXXbyYY_r.c: Likewise.
* elf/dl-load.c (_dl_map_object_from_fd): Map DSOs with MAP_DENYWRITE.
2004-04-21 Jakub Jelinek <jakub@redhat.com>
* posix/tst-chmod.c (do_test): Fix a typo.
* elf/lateglobal.c (main): Fix error checks.
Patch by Stephen Clarke <stephen.clarke@st.com>.
* manual/ctype.texi (isblank, iswblank): Mark as ISO functions,
mention they have been added in ISO C99.
Reported by Ben Pfaff <blp@cs.stanford.edu>.
2004-03-31 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/ieee754/ldbl-128/bits/huge_vall.h: Fix typo.
2004-04-01 Ulrich Drepper <drepper@redhat.com>
* elf/elf.h: Define more ppc64 specific dynamic tags.
* libio/fileops.c (new_do_write): Return _IO_size_t to make 64-bit
2004-03-22 Joseph S. Myers <jsm@polyomino.org.uk>
* sunrpc/rpc/xdr.h (IXDR_GET_LONG, IXDR_PUT_LONG): Do not use
casts as lvalues.
2004-03-22 Andreas Jaeger <aj@suse.de>
* elf/tst-dlmodcount.c (unload): Remove unused variable.
* misc/tst-mntent.c (main): Use tmpfile instead of tmpnam.
(parse_conf): Call it to parse lines starting with "include".
Remaining words are glob patterns for more config files to read.
Take additional bool argument to disable opt_chroot processing.
(main): Update caller.
* sysdeps/i386/dl-machine.h: Define ARCH_FIXUP_ATTRIBUTE and use
it in the fixup function declarations.
* elf/dl-runtime.c: If ARCH_FIXUP_ATTRIBUTE is not defined,
provide dummy definition. Use macro in fixup function
definitions.
2004-03-06 Ulrich Drepper <drepper@redhat.com>
* elf/dl-lookup.c: We don't need for specialized lookup functions.
Combining the functionality does not slow down relocation processing,
it might even speed it up a little.
* sysdeps/generic/ldsodefs.h: Adjust prototypes for lookup function.
Add only one function pointer to rtlf_global_ro.
* elf/do-lookup.h: Replace #ifs with ifs.
* elf/dl-libc.c: Adjust _dl_lookup_* callers.
* elf/dl-reloc.c: Likewise.
* elf/dl-runtime.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/rtld.c: Likewise. Adjust _rtld_global_ro initialization.
* sysdeps/generic/ldsodefs.h (__rtld_local_attribute__,
__rtld_global_attribute__): Undef after use.
(_rtld_local_ro): Define __rtld_local_attribute__ with just hidden
if available.
* sysdeps/alpha/Subdirs: New file.
* sysdeps/alpha/soft-fp/Makefile: New file.
* sysdeps/alpha/soft-fp/Versions: New file.
* sysdeps/alpha/soft-fp/local-soft-fp.h: New file.
* sysdeps/alpha/soft-fp/ots_add.c: New file.
* sysdeps/alpha/soft-fp/ots_cmp.c: new file.
* sysdeps/alpha/soft-fp/ots_cmpe.c: New file.
* sysdeps/alpha/soft-fp/ots_cvtqux.c: New file.
* sysdeps/alpha/soft-fp/ots_cvtqx.c: New file.
* sysdeps/alpha/soft-fp/ots_cvttx.c: New file.
* sysdeps/alpha/soft-fp/ots_cvtxq.c: New file.
* sysdeps/alpha/soft-fp/ots_cvtxt.c: New file.
* sysdeps/alpha/soft-fp/ots_div.c: New file.
* sysdeps/alpha/soft-fp/ots_mul.c: New file.
* sysdeps/alpha/soft-fp/ots_nintxq.c: New file.
* sysdeps/alpha/soft-fp/ots_sub.c: New file.
2004-03-06 Ulrich Drepper <drepper@redhat.com>
* elf/dl-open.c: No need to pass any parameter to _dl_start_profile.
They are the same in both places.
* elf/dl-profile.c: Likewise.
* elf/rtld.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* elf/dl-support.c: Define _dl_profile_output variable. Initialize it.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Move
dl_debug_fd to rtld_global_ro.
* elf/rtld.c: Use GLRO instead of GL for dl_debug_fd.
* elf/dl-misc.c: Likewise.
* elf/rtld.c (dl_main): Adjust l->l_ld of the vDSO by l->l_addr.
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Only set
GL(dl_sysinfo) if non-zero.
2004-02-26 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): Correctly set up l_map_end and l_addr
in vDSO's link_map, don't assume l_addr == 0. Set GL(dl_sysinfo)
from e_entry only if AT_SYSINFO not present and adjust by l_addr.
Take vDSO into account when inserting rtld into _dl_loaded chain.
2004-02-20 Ulrich Drepper <drepper@redhat.com>
* dlfcn/dlsym.c: Get ld.so loading lock before the call into ld.so.
* dlfcn/dlvsym.c: Likewise.
* elf/dl-addr.c: Get loading lock while using _dl_loaded data.
* elf/dl-fini.c: Likewise.
Patch by Shunichi Sagawa <s-sagawa@jp.fujitsu.com>.
2004-02-19 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/generic/libc-start.c [LIBC_START_DISABLE_INLINE] (STATIC):
Define as static.
* sysdeps/powerpc/elf/libc-start.c: Define LIBC_START_DISABLE_INLINE
because gcc does not allow inline of functions that call setjmp.
2004-02-19 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/Makefile: Use -finline-limit.
2004-02-19 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (_dl_argv): If DL_ARGV_NOT_RELRO defined, don't
use attribute_relro for _dl_argv.
* sysdeps/alpha/dl-machine.h (DL_ARGV_NOT_RELRO): Define.
* sysdeps/ia64/dl-machine.h (DL_ARGV_NOT_RELRO): Define.
* sysdeps/sparc/sparc32/dl-machine.h (DL_ARGV_NOT_RELRO): Define.
* sysdeps/sparc/sparc64/dl-machine.h (DL_ARGV_NOT_RELRO): Define.
vfork instead of fork.
2004-01-22 Jakub Jelinek <jakub@redhat.com>
* elf/dl-reloc.c (_dl_relocate_object): Move PT_GNU_RELRO protection
into...
(_dl_protect_relro): New routine.
* sysdeps/generic/ldsodefs.h (_dl_protect_relro): New prototype.
* elf/rtld.c (_dl_start_final): Copy l_relro_addr and l_relro_size
from bootstrap_map.
(_dl_main): Don't set GL(_dl_loaded)->l_relro_{addr,size} here.
Call _dl_protect_relro for libraries if prelinking.
2004-01-14 Ulrich Drepper <drepper@redhat.com>
* configure.in: Define HAVE_Z_RELRO if the linker supports -z relro.
* config.h.in: Add entry for HAVE_Z_RELRO.
* include/libc-symbols.h: Define attribute_relro.
* elf/dl-load.c: Add attribute_relro to env_path_list, capstr, ncapstr,
max_capstrlen, and max_dirnamelen definitions.
* elf/rtld.c: Add attribute_relro to _dl_argc, _dl_argv, _dl_skip_args,
load_time, start_time, library_path, preloadlist, version_info,
any_debug.
Remove rtld_total_time. Make it a local variable. Pass pointer to
it to print_statistics. Change print_statistics accordingly.
* sysdeps/generic/dl-sysdep.c: Add attribute_relro to _dl_auxv. Use
attribute_relro instead of explicitly assigning variable to the
.data.rel.ro section for __libc_enable_secure and __libc_stack_end.
* sysdeps/generic/ldsodefs.h: Declare __libc_stack_end, _dl_argc,
_dl_argv, _dl_argv_internal with attribute_relro.
2004-01-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/dl-machine.h: Include <tls.h>.
* elf/rtld.c (_dl_start_final): Initialze __libc_stack_end here.
* sysdeps/generic/dl-sysdep.c: Define __libc_stack_end with
rtld_hidden_def and move into .data.rel.ro section.
* sysdeps/generic/ldsodefs.h: Declare __libc_stack_end with
rtld_hidden_proto.
* sysdeps/generic/libc-start.c: Only initialize __libc_stack_end here
if !SHARED.
* sysdeps/unix/sysv/linux/dl-execstack.c
(_dl_make_stack_executable): Move common code in front. Use
__builtin_expect.
2004-01-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/dl-execstack.c: Change interface. Add
challenge for caller.
* sysdeps/generic/ldsodefs.h: Change declaration and type of hook
member in rtld_global appropriately.
* elf/dl-support.c: Likewise.
* elf/dl-load.c (_dl_map_object_from_fd): Take additional paramter.
Pass it on to the changed function.
(_dl_map_object): Pass new parameter to _dl_map_object_from_fd.
2004-01-13 Ulrich Drepper <drepper@redhat.com>
* Makeconfig: Define relro-LDFLAGS if have-z-relro==yes. Add it to
LDFLAGS.so and LDFLAGS-rtld.
(+link): Add relro-LDFLAGS.
* Makeconfig (shlib.lds): Place __libc_subfreeres, __libc_atexit, and
__libc_thread_subfreeres sections after .jcr section.
* config.make.in: Add have-z-relro.
* configure.in: Add check for -z relro option.
* include/link.h (struct link_map): Add relro_addr and relro_size
members.
* elf/dl-load.c (_dl_map_object_from_fd): Recognize PT_GNU_RELRO.
* elf/dl-reloc.c (_dl_relocate_object): At the end, make relro
part of loaded segments read-only.
* elf/elf.h: Define PT_GNU_RELRO.
* elf/rtld.c (_dl_start): Recognize PT_GNU_RELRO of ld.so.
(dl_main): Recognize PT_GNU_RELRO of the application. Call
_dl_debug_initialize and initialize l_info[DT_DEBUG] before
relocations.
2003-12-17 Ulrich Drepper <drepper@redhat.com>
* elf/rtld.c: Don't use strong_alias to define _rtld_local. This
removes the visibility attributes which might be defined earlier
for some gcc versions. Instead spell out what strong_alias does
plus the visibility.
2003-12-02 David Mosberger <davidm@hpl.hp.com>
* sysdeps/ia64/elf/initfini.c: Add unwind info.
* sysdeps/ia64/dl-machine.h (elf_machine_matches_host): Mark with
attribute "unused".
(elf_machine_dynamic): Mark with attributes "unused" and "const".
(elf_machine_runtime_setup): Likewise.
* sysdeps/generic/dl-fptr.c (make_fptr_table): Mark with
attribute "always_inline".
* sysdeps/ia64/dl-machine.h (__ia64_init_bootstrap_fdesc_table):
Likewise.
* configure.in: Check whether compiler has libunwind support.
* config.make.in (have-cc-with-libunwind): New variable.
* config.h.in (HAVE_CC_WITH_LIBUNWIND): New macro.
* Makeconfig (gnulib): If have-cc-withh-libunwind is "yes", also
mention -lunwind.
003-11-12 David Mosberger <davidm@hpl.hp.com>
* sysdeps/unix/sysv/linux/ia64/sysdep.h: Define DO_CALL_VIA_BREAK.
Redefine DO_CALL to use vdso if supported, otherwise DO_CALL_VIA_BREAK.
Likewise for DO_INLINE_SYSCALL. Make INTERNAL_SYSCALL use
DO_INLINE_SYSCALL.
* sysdeps/unix/sysv/linux/ia64/vfork.S: Use DO_CALL_VIA_BREAK()
instead of DO_CALL().
* sysdeps/unix/sysv/linux/ia64/clone2.S: Use break directly instead
of DO_CALL().
* sysdeps/unix/sysv/linux/ia64/brk.S (__curbrk): Restructure it
to take advantage of DO_CALL() macro.
* sysdeps/unix/sysv/linux/ia64/setcontext.S: Likewise.
* sysdeps/unix/sysv/linux/ia64/getcontext.S: Likewise.
* elf/rtld.c (dl_main): Restrict dl_sysinfo_dso check to first
program header. On ia64, the check failed previously because
there are two program headers.
* sysdeps/generic/s_nexttowardf.c: Likewise.
* math/bug-nexttoward.c: New file.
2003-11-25 Ulrich Drepper <drepper@redhat.com>
* posix/runptests.c (main): Make errors fatal.
* posix/PTESTS: One test in GA135 and GA136 check functionality
which seems not guaranteed.
2003-11-25 Jakub Jelinek <jakub@redhat.com>
* posix/regexec.c (re_search_internal): If prune_impossible_nodes
returned REG_NOMATCH, set match_last to -1. Don't initialize
pmatch[0] needlessly. Fix comment.
(prune_impossible_nodes): Don't segfault on NULL state_log entry.
(set_regs): Fix comment.
* posix/regcomp.c (parse_bracket_exp): Only set has_plural_match
if adding both SIMPLE_BRACKET and COMPLEX_BRACKET.
(build_charclass_op): Set has_plural_match if adding both
SIMPLE_BRACKET and COMPLEX_BRACKET.
* posix/bug-regex11.c (tests): Fix register values for one commented
out test. Add new tests.
* posix/regex_internal.c (re_string_allocate): Make sure init_len
is at least dfa->mb_cur_max.
(re_string_reconstruct): If is_utf8, don't fall back into
re_string_skip_chars just because idx points into a middle of
valid UTF-8 character. Instead, set the wcs bytes which correspond
to the partial character bytes to WEOF.
* posix/regexec.c (re_search_internal): Allocate input.bufs_len + 1
instead of dfa->nodes_len + 1 state_log entries initially.
* posix/bug-regex20.c (main): Uncomment backwards case insensitive
tests.
* include/dlfcn.h (__RTLD_OPENEXEC): Define.
* elf/dl-load.c (_dl_map_object_from_fd): Don't allow loading
executables unless __RTLD_OPENEXEC flag is present.
* elf/rtld.c (dl_main): Pass __RTLD_OPENEXEC flag to
_dl_map_object when loading the executable.
reverse lookup format for IPv6 addresses is using bitstring and
* resolv/ns_name.c: Implement encoding and decoding bitstring in
2003-10-15 Roland McGrath <roland@redhat.com>
* elf/dl-iteratephdr.c [! SHARED] (dl_iterate_phdr): New function.
Fake an entry for the main executable and then call __dl_iterate_phdr.
* elf/Makefile (routines): Remove dl-iteratephdr-static.
(elide-routines.os): Likewise.
(CFLAGS-dl-iterate-phdr-static.c): Variable removed.
* sysdeps/generic/dl-iteratephdr-static.c: File removed.
* sysdeps/unix/sysv/linux/ia64/dl-iteratephdr-static.c: File removed.
2003-10-01 Thorsten Kukuk <kukuk@suse.de>
* elf/dl-reloc.c (_dl_allocate_static_tls): Move definition of
variables only used if TLS_DTV_AT_TP is defined into the #if branch.
2003-09-30 Ulrich Drepper <drepper@redhat.com>
* elf/rtld.c (dl_main): Also set l_map_start.
2003-09-30 Daniel Jacobowitz <drow@mvista.com>
* elf/rtld.c (dl_main): Set l_libname and l_name for the sysinfo DSO
to work around kernel problem.
2003-09-27 Wolfram Gloger <wg@malloc.de>
* malloc/malloc.c: Include <malloc-machine.h> earlier instead of
"thread-m.h", so that default parameters can be overridden in a
system-specific malloc-machine.h. Remove extra ; from extern "C"
closing brace.
* sysdeps/generic/malloc-machine.h: New file.
* sysdeps/mach/hurd/malloc-machine.h: New file.
* malloc/thread-m.h: Removed.
* malloc/Makefile: Remove CFLAGS-malloc.c parameter addition, it
is in sysdeps/generic/malloc-machine.h now.
* elf/dl-reloc.c (_dl_allocate_static_tls): Move definition of
variables only used if TLS_TCB_AT_TP is defined into the #if
branch.
GL(dl_stack_flags) according to rtld's own PT_GNU_STACK.
Move GL(dl_make_stack_executable_hook) initialization up.
* elf/tst-execstack-prog.c: New file.
* elf/Makefile (tests-execstack-yes): Add it.
(LDFLAGS-tst-execstack-prog): New variable.
calling _dl_start, using GOTOFF access.
* configure.in (libc_cv_z_execstack): New check.
* configure: Regenerated.
* config.make.in (have-z-execstack): New variable set by it.
* elf/tst-execstack.c: New file.
* elf/tst-execstack-mod.c: New file.
* elf/tst-execstack-needed.c: New file.
* elf/Makefile (tests-execstack-yes, modules-execstack-yes): New
variables.
(tests, modules-names): Conditionally include them.
(distribute): Add tst-execstack-mod.c here.
($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
(LDFLAGS-tst-execstack, LDFLAGS-tst-execstack-mod): New variables.
($(objpfx)tst-execstack-needed): New target.
(LDFLAGS-tst-execstack-needed): New variable.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Add _dl_stack_flags
and _dl_make_stack_executable_hook. Declare _dl_make_stack_executable.
* elf/rtld.c (_rtld_global): Add initializer for _dl_stack_flags.
(dl_main): Reset _dl_stack_flags according to PT_GNU_STACK phdr.
Initialize _dl_make_stack_executable_hook.
* elf/dl-support.c: Define those new variables.
(_dl_non_dynamic_init): Scan phdrs for PT_GNU_STACK.
(_dl_phdr): Fix type.
* elf/dl-load.c (_dl_map_object_from_fd): Grok PT_GNU_STACK phdr and
enable execute permission for the stack if necessary.
* sysdeps/generic/dl-execstack.c: New file.
* elf/Makefile (dl-routines): Add it.
* elf/Versions (ld: GLIBC_PRIVATE): Add _dl_make_stack_executable.
* sysdeps/unix/sysv/linux/dl-execstack.c: New file.
2003-09-17 Philip Blundell <philb@gnu.org>
* sysdeps/unix/sysv/linux/arm/vfork.S: Branch to fork if
libpthread is loaded. Elide backwards compatibility code when not
required.