ld.so.
* malloc/malloc.c (_int_malloc): Use full list insert and not
shortcut which assumes the list is empty for large requests
too.
* elf/tst-addr1.c (do_test): Allow i.dli_sname "_IO_printf".
2006-08-24 Ulrich Drepper <drepper@redhat.com>
[BZ #2683]
* elf/dl-addr.c (_dl_addr): Don't ignore all undefined symbols.
If symbol has a value use it.
* elf/tst-dladdr1.c: New file.
* elf/Makefile: Add rules to build and run tst-addr1.
2006-06-23 Joseph Myers <joseph@codesourcery.com>
[BZ #2980]
* posix/Makefile (CFLAGS-waitid.c): Add
-fasynchronous-unwind-tables.
2006-08-02 Ulrich Drepper <drepper@redhat.com>
* elf/dl-addr.c (_dl_addr): If GNU-style hash tables are present,
walk them instead of the symbol table.
(_dl_lookup_symbol_x): Rename hash to old_hash and don't compute
value here. Compute new-style hash value. Pass new hash value
and reference to variable with the old value to do_lookup_x.
(_dl_setup_hash): If DT_GNU_HASH is defined, use it and not
old-style hash table.
(_dl_debug_bindings): Pass new hash value and reference to variable
with the old value to do_lookup_x.
* elf/do-lookup.h (do_lookup_x): Accept additional parameter with
new-style hash value and change old-style hash value parameter to
be a reference. Reoganize functions to determine whether
new-style hash table is available. Only fall back on old-style
table. If old-style hash value is needed, compute it here.
* elf/dynamic-link.h (elf_get_dynamic_info): Relocate DT_GNU_HASH
entry.
* elf/elf.h: Define SHT_GNU_HASH, DT_GNU_HASH, DT_TLSDEC_PLT,
DT_TLSDEC_GOT. Adjust DT_ADDRNUM.
* include/link.h (struct link_map): Add l_gnu_bitmask_idxbits,
l_gnu_shift, l_gnu_bitmask, l_gnu_buckets and l_gnu_chain_zero.
* Makeconfig: If linker supports --hash-style option add it to all
linker command lines to build DSOs.
* config.make.in: Define have-hash-style.
* configure.in: Test whether linker supports --hash-style option.
* elf/dl-misc.c (_dl_name_match_p): Make MAP parameter const.
* sysdeps/generic/ldsodefs.h: Adjust prototype.
was allocated here. [Coverity CID 219]
* posix/getconf.c (print_all): Free confstr data after printing.
[Coverity CID 218]
* sysdeps/posix/getaddrinfo.c (gaih_inet): Free canon string if
list allocation fails. [Coverity CID 215]
* nss/nsswitch.c (__nss_configure_lookup): Fix loop end condition.
[Coverity CID 213]
* argp/argp-help.c (hol_entry_cmp): Don't call canon_doc_option if
string is NULL. [Coverity CID 212]
* argp/Makefile: Add rules to build and run bug-argp1.
* argp/bug-argp1.c: New file.
* io/ftw.c (ftw_dir): Use __rawmemchr instead of strchr to find
end of string.
* stdlib/canonicalize.c (__realpath): Likewise.
* locale/programs/ld-time.c (time_finish): Don't dereference NULL
pointer. [Coverity CID 206]
* elf/dl-dst.h (DL_DST_REQUIRED): Be prepared for missing link map
in statically linked code.
* elf/dl-load.c (_dl_dst_substitute): When replacing ORIGIN in
statically built code, be prepared to have no link map.
[Coverity CID 205]
* argp/argp-help.c (fill_in_uparams): Handle STATE==NULL in
dgettext calls. [Coverity CID 204]
* argp/argp-help.c (struct uparams): Remove valid member. Change
the one user.
(uparam_names): Reduce size. Avoid relative relocations.
Moved to read-only segment.
(fill_in_uparams): Update for new layout.
* sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs): Parameter can be
assumed to always be != NULL. [Coverity CID 202]
* argp/argp-help.c (hol_entry_help): Remove some dead code
[Coverity CID 200].
* nis/nss_nis/nis-service.c (_nss_nis_getservbyport_r): Optimize
away a few more unconditional yperr2nss calls.
(_nss_nis_getservbyname_r): Likewise.
invalid length [Coverity CID 106].
* nss/nss_files/files-key.c (search): Close stream before
successful return [Coverity CID 107].
* io/fts.c (fts_open): Don't allocate parent if *argv==NULL
[Coverity CID 108].
* sunrpc/rpc_cout.c (inline_struct): Free sizestr after use
[Coverity CID 110, 109].
* sunrpc/rpc_scan.c (docppline): Free file string if it is not
going to be used [Coverity CID 111].
* sysdeps/unix/sysv/linux/getsourcefilter.c (getsourcefilter): Free
memory if socket level value cannot be retrieved [Coverity CID 112].
* nis/nis_clone_dir.c (nis_clone_directory): Free all memory in
error case [Coverity CID 114].
* nis/nis_clone_res.c (nis_clone_result): Free all memory in the
error cases [Coverity CID 115].
* sunrpc/rpc_parse.c (get_definition): Free defp if tok ==
TOK_EOF [Coverity CID 116].
* sysdeps/unix/sysv/linux/setsourcefilter.c (setsourcefilter): Free
memory if socket level value cannot be retrieved [Coverity CID 117].
* elf/cache.c (save_cache): Initialize pad to avoid writing
uninitialized data to disk.
* elf/cache.c (save_cache): Free file_entries_new [Coverity CID 118].
* intl/finddomain.c (_nl_find_domain): Avoid strdup of expand
locale name, use strdupa. Remove free call [Coverity CID 119].
* sunrpc/rpc_main.c (generate_guard): Avoid extra allocation and
the resulting leak [Coverity CID 121].
* sunrpc/rpc_main.c (mkfile_output): Free all allocated memory
[Coverity CID 122].
* sunrpc/rpc_main.c (h_output): Free guard after we are done
[Coverity CID 123].
* sunrpc/svc_udp.c (cache_set): Free victim if newbuf allocation
fails [Coverity CID 126].
* sunrpc/svc_udp.c (svcudp_enablecache): Free memory in error
cases [Coverity CID 127].
* nis/nis_table.c (__create_ib_request): Free ibreq in case strdup
fails [Coverity CID 128].
* nis/nis_getservlist.c (nis_getservlist): Free all memory in case
of an error [Coverity CID 130, 129].
* nis/nis_print_group_entry.c (nis_print_group_entry): If
nis_lookup call failed, return. Free lookup result in error
cases [Coverity CID 131].
* nis/nis_removemember.c (nis_removemember): Free all memory in
error cases [Coverity CID 132].
* nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
Always free lookup result [Coverity CID 134].
* nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_gethostton_r):
Always free lookup result [Coverity CID 135].
* nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_getntohost_r):
Always free lookup result [Coverity CID 136].
* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
Before retrying, free old result [Coverity CID 137].
* nis/nss_nisplus/nisplus-publickey.c (_nss_nisplus_netname2user):
Free res in case UID is zero [Coverity CID 138].
* nis/ypclnt.c (yp_update): Always free master string
[Coverity CID 140].
* nis/nis_creategroup.c (nis_creategroup): Free all memory in
error cases [Coverity CID 143, 142, 141].
* nis/nss_nis/nis-publickey.c (_nss_nis_getpublickey): Free result
if yp_match call succeeded [Coverity CID 155].
* nis/nss_nis/nis-publickey.c (_nss_nis_getsecretkey): Free string
allocated in yp_match at all times [Coverity CID 157, 156].
* nscd/nscd.c (write_pid): Close stream also if writing failed
[Coverity CID 165].
* nis/nis_table.c (nis_add_entry): Move test for NULL parameter
ahead of first use [Coverity CID 167].
* nis/nss_nis/nis-alias.c (_nss_nis_getaliasbyname_r): Move test
for NULL parameter ahead of first use [Coverity CID 168].
* intl/finddomain.c (_nl_find_domain): We never return NULL if we
found the locale [Coverity CID 169].
* inet/getnameinfo.c (getnameinfo): __getservbyport_r does not set
herrno [Coverity CID 178].
* nis/nis_checkpoint.c (nis_checkpoint): Don't access and returned
freed object [Coverity CID 182].
From Alexandre Oliva <aoliva@redhat.com>.
* elf/tst-audit2.c: New file.
* elf/Makefile (tests): Add it.
($(objpfx)tst-audit2.out): New target.
(tst-audit2-ENV): New variable.
* elf/tst-leaks1.c: Include <stdio.h>.
2006-03-13 Jakub Jelinek <jakub@redhat.com>
[BZ #2451]
* elf/dl-load.c (open_verify): Add free_name argument, if true, free
name before calling lose.
(open_path): Adjust caller.
(_dl_map_object): Adjust callers. Free name_copy before calling
_dl_signal_error.
* elf/Makefile: Add rules to build and run tst-leaks1.
* elf/tst-leaks1.c: New test.
* elf/check-textrel.c: Include config.h.
(AB(handle_file)): Don't fail if PF_X | PF_W on architectures known
to have executable writable PLT.
* sysdeps/powerpc/powerpc32/configure.in (HAVE_PPC_SECURE_PLT): New
test.
* config.h.in (HAVE_PPC_SECURE_PLT): Add.
* malloc/malloc.c (MALLOC_ALIGNMENT): Set to __alignof__ (long double)
if long double is more aligned than 2 * SIZE_SZ.
(misaligned_chunk): Define.
(public_rEALLOc, _int_free, _int_realloc): Use it.
* elf/Makefile (tests): Add it.
($(objpfx)tst-tls-dlinfo): Depend on $(libdl).
($(objpfx)tst-tls-dlinfo.out): Depend on $(objpfx)tst-tlsmod2.so.
* dlfcn/dlfcn.h (RTLD_DI_PROFILENAME, RTLD_DI_PROFILEOUT): New enum
values, reserve unsupported requested names used on Solaris.
(RTLD_DI_TLS_MODID, RTLD_DI_TLS_DATA): New enum values.
(RTLD_DI_MAX): Likewise.
* dlfcn/dlinfo.c (dlinfo_doit): Handle RTLD_DI_TLS_MODID and
RTLD_DI_TLS_DATA.
* elf/dl-tls.c (_dl_tls_get_addr_soft): New function.
* sysdeps/generic/ldsodefs.h: Declare it.
* elf/Versions (ld: GLIBC_PRIVATE): Add it.
* elf/link.h (struct dl_phdr_info): New members dlpi_tls_modid,
dlpi_tls_data.
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Fill them in.
* include/link.h: Don't copy contents from elf/link.h.
Instead, #include it while #define'ing around link_map.
* elf/dl-debug.c (_dl_debug_initialize): Add a cast.
Add bogus extern decl to verify link_map members.
* elf/loadtest.c (MAPS): New macro, cast _r_debug._r_map.
(OUT, main): Use it in place of _r_debug._r_map.
* elf/unload.c: Likewise.
* elf/unload2.c: Likewise.
* elf/neededtest.c (check_loaded_objects): Likewise.
* elf/neededtest2.c (check_loaded_objects): Likewise.
* elf/neededtest3.c (check_loaded_objects): Likewise.
* elf/neededtest4.c (check_loaded_objects): Likewise.
* elf/circleload1.c (check_loaded_objects): Likewise.
* sysdeps/sparc/dl-procinfo.h (HWCAP_IMPORTANT): Add it.
(_DL_HWCAP_COUNT): Increase to 7.
* sysdeps/sparc/dl-procinfo.c (_dl_sparc_cap_flags): Add "v9v".
From David S. Miller <davem@sunset.davemloft.net>.
* elf/Makefile: Add rules to build and run check-localplt.
* scripts/data/localplt-x86_64-linux-gnu.data: New file.
* scripts/data/localplt-i386-linux-gnu.data: New file.
Tom Gall <tom_gall@vnet.ibm.com>
* elf/rtld.c (dl_main): Initialize l_local_scope for sysinfo_map.
* sysdeps/powerpc/elf/libc-start.c: Move this...
* sysdeps/unix/sysv/linux/powerpc/libc-start.c: ...to here.
* sysdeps/powerpc/powerpc32/dl-start.S: Add _dl_main_dispatch label.
* sysdeps/powerpc/powerpc32/hp-timing.h: New file.
* sysdeps/unix/sysv/linux/powerpc/Versions: New file.
* sysdeps/unix/sysv/linux/clock_getres.c: If HAVE_CLOCK_GETRES_VSYSCALL
is not defined, redefine INTERNAL_VSYSCALL and INLINE_VSYSCALL to
INTERNAL_SYSCALL and INLINE_SYSCALL respectively. Otherwise include
<bits/libc-vdso.h>. Use INLINE_VSYSCALL and INTERNAL_SYSCALL instead
of the normal versions throughout the code.
* sysdeps/unix/sysv/linux/clock_gettime.c: Likewise if
HAVE_CLOCK_GETTIME_VSYSCALL is defined.
* sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h: New file.
* sysdeps/unix/sysv/linux/powerpc/dl-vdso.c: New file.
* sysdeps/unix/sysv/linux/powerpc/dl-vdso.h: New file.
* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Use vDSO.
* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: New file.
* sysdeps/unix/sysv/linux/powerpc/Makefile: Add dl-vdso to routines.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Define
INLINE_VSYSCALL, INTERNAL_VSYSCALL, INTERNAL_SYSCALL_NCS,
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, HAVE_CLOCK_GETRES_VSYSCALL,
and HAVE_CLOCK_GETTIME_VSYSCALL.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
* elf/rtld.c: Define __pointer_chk_guard_local and if necessary
__pointer_chk_guard.
(_rtld_global_ro): Initialize _dl_pointer_guard.
(dl_main): Initialize __pointer_chk_guard_local and either
__pointer_chk_guard or TLS value if necessary.
(process_envvars): Recognize and handle LD_POINTER_GUARD.
* sysdeps/generic/ldsodefs.h (rtld_global_ro): Add _dl_pointer_guard.
* sysdeps/i386/__longjmp.S: Use PTR_DEMANGLE for PC if defined.
* sysdeps/x86_64/__longjmp.S: Likewise.
* sysdeps/i386/bsd-_setjmp.S: Use PTR_MANGLE for PC if defined.
* sysdeps/i386/bsd-_setjmp.S: Likewise.
* sysdeps/i386/setjmp.S: Likewise.
[IS_IN_rtld]: Avoid call to __sigjmp_save.
* sysdeps/i386/setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Define PTR_MANGLE and
PTR_DEMANGLE.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/i386/elf/setjmp.S: Removed.
* sysdeps/i386/elf/bsd-setjmp.S: Removed.
* elf/dl-conflict.c (_dl_resolve_conflicts): Use _dl_debug_printf
instead of _dl_printf to print conflict processing debug message.
Reported by John Reiser <jreiser@BitWagon.com>.
* elf/dl-load.c (MAP_COPY): When undefined, define to
MAP_PRIVATE|MAP_DENYWRITE instead of just MAP_PRIVATE.
(_dl_map_object_from_fd): Don't use MAP_DENYWRITE explicitly.
Use ARCH_PLTENTER_MEMBERS and ARCH_PLTEXIT_MEMBERS macros if defined.
* elf/tst-auditmod1.c: Include <tst-audit.h> to define more
architecture-specific code.
* sysdeps/generic/tst-audit.h: New file.
* elf/Makefile (distribute): Add it.
2005-09-20 Roland McGrath <roland@redhat.com>
[BZ #1346]
* elf/dl-load.c (_dl_map_object_from_fd) [HAVE_Z_RELRO]: Do relro
magic on __stack_prot only if [SHARED]. Skip mprotect if __stack_prot
lies outside the page-rounded-down relro region.
2005-08-01 Bob Wilson <bob.wilson@acm.org>
Richard Sandiford <richard@codesourcery.com>
* sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Add missing
exponent bias to the value for 2^126.
2005-08-30 Jakub Jelinek <jakub@redhat.com>
Alan Modra <amodra@bigpond.net.au>
* elf/dl-addr.c (_dl_addr): Use DL_ADDR_SYM_MATCH macro.
* sysdeps/generic/ldsodefs.h (DL_ADDR_SYM_MATCH): Define.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h: New file.
* 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-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/clock_gettime.c (clock_gettime): Implement case
where HANDLED_REALTIME is not defined. [BZ #966]
2005-06-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/netlinkaccess.h (__netlink_sendreq,
__netlink_receive): Remove prototypes.
(__netlink_request): New prototype.
* sysdeps/unix/sysv/linux/ifaddrs.c: Include <alloca.h> and
<stdint.h>.
(__netlink_sendreq): Make static.
(__netlink_receive): Rename to...
(__netlink_request): ... this. Add type argument, call
__netlink_sendreq. If MSG_TRUNC is set after recvmsg, retry
with a bigger buffer. Don't record buffers that contain no
messages we are expecting.
(getifaddrs): Use __netlink_request instead of __netlink_sendreq
and __netlink_receive pairs. Formatting.
* sysdeps/unix/sysv/linux/if_index.c (if_nameindex_netlink): Use
__netlink_request instead of __netlink_sendreq and __netlink_receive
pair.
2005-06-13 Thorsten Kukuk <kukuk@suse.de>
* sysdeps/unix/sysv/linux/netinet/if_tr.h: Don't include kernel
headers, instead copy important structs/defines.
2005-06-13 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): Move DT_DEBUG setup before first
_dl_debug_state call.
real malloc in the catch object.
(_dl_catch_error): Forward information about malloc use to caller
in new parameter.
(_dl_out_of_memory): Make static.
* elf/dl-deps.c: Adjust callers of _dl_catch_error.
* elf/dl-libc.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/rtld.c: Likewise.
Add new --audit option.
* sysdeps/generic/ldsodefs.h: Remove _dl_out_of_memory declaration.
(rtld_global_ro._dl_signal_error): Add new parameter.
* include/dlfcn.h (_dl_catch_error): Add new parameter.
* dlfcn/dlfcn.c (_dlerror_run): Pass additional parameter to
_dl_catch_error. Only free if the returned newly value says so.
(_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.
* malloc/hooks.c (mem2chunk_check): Add magic_p argument, set *magic_p
if magic_p is not NULL.
(top_check): Invoke MALLOC_FAILURE_ACTION if MORECORE failed.
(malloc_check): Fail if sz == -1.
(free_check): Adjust mem2chunk_check caller.
(realloc_check): Likewise. Fail if bytes == -1. If bytes == 0 and
oldmem != NULL, call free_check and return NULL. If reallocating
and returning NULL, invert magic byte again to make oldmem valid
region for further checking.
(memalign_check): Fail if bytes == -1.
* malloc/Makefile: Add rules to build and run tst-mcheck.
* malloc/tst-mcheck.c: New test.
(INTERNAL_SYSCALL_ERROR_P): Fix typo in last change.
* sunrpc/xdr.c (xdr_u_int): Use `long' for L and cast where needed.
* elf/dl-load.c: Revert last change.
* elf/tls-macros.h: Add Sparc64 defines.
* sysdeps/sparc/sparc64/dl-machine.h (sparc64_fixup_plt): Mark as
always_inline.
(elf_machine_fixup_plt): Likewise.
(elf_machine_rela): Handle TLS relocations.
(elf_machine_type_cleaa): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
(SYSCALL_ERROR_HANDLER_ENTRY): Use sethi/or for GOT reloc.
It does not always fit in R_SPARC_GOT13 when building -fPIC.
Also, add TLS handling.
* sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel):
Increase it to 2.4.21 for sparc64.
* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: NULL terminate
backtrace by zero'ing out %fp. Store away flags, func_ptr,
and func_arg in global registers not local registers.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Handle PTID, TLS,
and CTID arguments properly. Add RESET_PID handling.
* sysdeps/unix/sysv/linux/sparc/sparc64/pause.c: Rework so that we
do not invoke __sigprocmask(). We can always assume rt signals
are present on sparc64, so just do an inline syscall.
2005-04-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc64/dl-machine.h: Add dl_machine_h multiple
inclusion guard for the first half of the header.
(elf_machine_type_class, ELF_MACHINE_JMP_SLOT, ELF_MACHINE_NO_REL,
ELF_MACHINE_PLTREL_OVERLAP, elf_machine_runtime_setup,
elf_machine_relplt, DL_STACK_END, RTLD_START): Move into the
#ifndef dl_machine_h guarded part of the header.
[(NEED_DL_SYSINFO || NEED_DL_SYSINFO_DSO) && SHARED]: Scan
GLRO(dl_sysinfo_map) for PT_NOTE giving Linux kernel version,
we can skip the uname call if it's there.
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Don't use
DL_SYSDEP_OSCHECK here.
* elf/rtld.c (dl_main) [DL_SYSDEP_OSCHECK]: Do it here instead.
* sysdeps/generic/ldsodefs.h (struct rtld_global_ro):
Add _dl_sysinfo_map.
* elf/rtld.c (dl_main): Don't call _dl_init_paths early in the
rtld_is_main case. Call it unconditionally later.
Move GLRO(dl_sysinfo_dso) handling earlier, before _dl_init_paths call.
Initialize GLRO(dl_sysinfo_map).
* elf/dl-load.c (open_path): Bail out if _dl_init_paths wasn't called.
* sysdeps/generic/dl-sysdep.c (_DL_FIRST_EXTRA): New macro.
(_dl_important_hwcaps)
[(NEED_DL_SYSINFO || NEED_DL_SYSINFO_DSO) && SHARED]: Scan
GLRO(dl_sysinfo_map) for PT_NOTE giving synthetic hwcap names
and bit values.
* elf/ldconfig.c (_DL_FIRST_EXTRA): New macro.
(hwcap_extra): New static variable.
(is_hwcap_platform): Check hwcap_extra for a matching name.
Remove tls special case.
(path_hwcap): Likewise.
(parse_conf): Parse "hwcap" directive to define synthetic hwcap bits
and their names, stored in hwcap_extra.
(main) [USE_TLS]: Initialize final synthetic hwcap bit as "tls".
* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Use uint64_t for
_dl_hwcap and _dl_hwcap_mask.
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Cast a_val for
AT_HWCAP to unsigned long int.
* elf/dl-support.c (_dl_aux_init): Likewise.
(_dl_hwcap): Update defn.
* elf/cache.c (print_entry): Pad hwcap value with 0s in diagnostic.
* elf/ldconfig.c (search_dir): Likewise.
2005-03-15 Jakub Jelinek <jakub@redhat.com>
[BZ #786]
* sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Handle
GL(dl_tls_static_nelem) == GL(dl_tls_max_dtv_idx).
* elf/Makefile: Add rules to build and run tst-tls15.
* elf/tst-tls15.c: New test.
* elf/tst-tlsmod15a.c: New file.
* elf/tst-tlsmod15b.c: New file.
2005-03-20 Ulrich Drepper <drepper@redhat.com>
* elf/rtld.c (dl_main): Always call init_tls if we have audit modules.
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.