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.
2003-08-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/syscalls.list: Add time syscall.
* elf/Makefile: Use LC_ALL=C in a few cases where we call external
text processing tools.
* sysdeps/pthread/aio_misc.h (struct waitlist): Don't add caller_pid
element unless BROKEN_THREAD_SIGNALS is defined.
(struct requestlist): Likewise.
* sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Don't fill in
caller_pid of new request unless BROKEN_THREAD_SIGNALS is defined.
* sysdeps/pthread/aio_suspend.c (aio_suspend): Likewise.
* sysdeps/pthread/aio_notify.c (__aio_notify_only): Remove caller_pid
parameter unless BROKEN_THREAD_SIGNALS is defined. Adjust callers.
Pass current PID to __aio_sigqueue.
* sysdeps/pthread/lio_listio.c (lio_listio): Adjust __aio_notify_only
call. Don't initialize caller_pid field of waitlist element.
2003-07-24 Ulrich Drepper <drepper@redhat.com>
* include/link.h (struct link_map): Add l_tls_firstbyte_offset field.
* sysdeps/generic/dl-tls.c [TLS_TCB_AT_TP] (_dl_determine_tlsoffset):
Fix calculation of offsets to take misalignment of first byte in
file into account.
* elf/dl-load.c (_dl_map_object_from_fd): Initialize
l_tls_firstbyte_offset field.
* elf/rtld.c (_dl_start_final, _dl_start, dl_main): Likewise.
* elf/dl-reloc.c (_dl_allocate_static_tls): Change return type to int.
Take l_tls_firstbyte_offset information into account.
(CHECK_STATIS_TLS): _dl_allocate_static_tls can fail now.
* sysdeps/generic/ldsodefs.h: Adjust _dl_allocate_static_tls prototype.
* elf/Makefile: Add rules to build and run tst-tls14.
* elf/tst-tls14.c: New file.
* elf/tst-tlsmod14a.c: New file.
* elf/tst-tlsmod14b.c: New file.
2003-07-22 H.J. Lu <hongjiu.lu@intel.com>
* elf/dl-support.c (_dl_hwcap): New variable.
(_dl_aux_init): Initialize GL(dl_hwcap) for static binaries.
* sysdeps/i386/fpu/fclrexcpt.c: Include <unistd.h>, <ldsodefs.h>
and <dl-procinfo.h>.
(__feclearexcept): Clear MXCSR if needed.
* sysdeps/i386/fpu/fsetexcptflg.c: Likewise.
* sysdeps/i386/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Document
that newer hardware needs more than these macros.
* sysdeps/i386/setfpucw.c: New file.
2003-07-22 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile (CFLAGS-ldconfig.c): Define IS_IN_ldconfig.
* elf/ldconfig.c: Include dl-procinfo.c.
(PROCINFO_CLASS): Define.
* sysdeps/generic/ldsodefs.h (PROCINFO_CLASS): Define.
* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: New file.
* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: New file.
* sysdeps/unix/sysv/linux/i386/dl-procinfo.c (PROCINFO_CLASS):
Define if not yet defined. Use it instead of EXTERN. Undefine
at the end of the file.
* sysdeps/unix/sysv/linux/arm/dl-procinfo.c (PROCINFO_CLASS):
Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c
(PROCINFO_CLASS): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c
(PROCINFO_CLASS): Likewise.
2003-07-22 H.J. Lu <hongjiu.lu@intel.com>
* elf/ldconfig.c (main): Issue a fatal error if relative path
is used to build cache.
2003-07-22 Ulrich Drepper <drepper@redhat.com>
* elf/readlib.c (process_file): Avoid possible overflow in assignment.
2003-07-21 Ulrich Drepper <drepper@redhat.com>
* Makerules (build-module-helper): Add -z defs unless explicitly said
not to do it.
* dlfcn/Makefile: Define various *-no-z-defs variables for test DSOs
which has undefined symbols.
* elf/Makefile: Likewise.
2003-04-16 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile (distribute): Add tst-tlsmod{[7-9],1[0-2]}.c and
tst-tls10.h.
(tests): Add tst-tls1[0-2].
(modules-names): Add tst-tlsmod{[7-8],1[0-2]}.
($(objpfx)tst-tlsmod8.so): Depend on tst-tlsmod7.so.
($(objpfx)tst-tlsmod10.so): Depend on tst-tlsmod9.so.
($(objpfx)tst-tlsmod12.so): Depend on tst-tlsmod11.so.
($(objpfx)tst-tls10): Depend on tst-tlsmod8.so.
($(objpfx)tst-tls11): Depend on tst-tlsmod10.so.
($(objpfx)tst-tls12): Depend on tst-tlsmod12.so.
* elf/tst-tls10.c: New test.
* elf/tst-tls11.c: New test.
* elf/tst-tls12.c: New test.
* elf/tst-tls10.h: New file.
* elf/tst-tlsmod7.c: New file.
* elf/tst-tlsmod8.c: New file.
* elf/tst-tlsmod9.c: New file.
* elf/tst-tlsmod10.c: New file.
* elf/tst-tlsmod11.c: New file.
* elf/tst-tlsmod12.c: New file.
2003-04-15 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/bits/atomic.h: Moved ppc32/64 specific code to ...
* sysdeps/powerpc/powerpc32/bits/atomic.h: New file.
* sysdeps/powerpc/powerpc64/bits/atomic.h: New file.
* posix/regex.h: Include <sys/types.h>.
Ignore exit status from diff.
* configure.in (enable_check_abi): Document possible value "warn".
Change default to no for now.
* configure: Regenerated.
* sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Emit stub_warning
macro calls and a #include <stub-tag.h> at the end.
* Makerules ($(objpfx)stubs): Tweak sed commands.
* sysdeps/unix/sysv/linux/syscalls.list: Use - rather than EXTRA in
caller column for *xattr syscalls, since they are in sysdeps/generic.
* sysdeps/unix/sysv/linux/i386/setfsuid.c: setfsgid -> setfsuid
* sysdeps/unix/sysv/linux/i386/setfsgid.c: setfsuid -> setfsgid
2003-03-26 Roland McGrath <roland@redhat.com>
* Makerules (check-abi-config): Use /thread instead of /tls when
use-thread and not just use-tls is set.
* Makerules (update-abi): Put quotes around $(update-abi-config).
* elf/Makefile (check-abi): Depend on check-abi-ld.
(update-abi): Depend on update-abi-ld.
2003-02-10 Ulrich Drepper <drepper@redhat.com>
* elf/Makefile (check-textrel-CFLAGS): Pass _XOPEN_SOURCE and
_BSD_SOURCE to compiler.
* elf/check-textrel.c (SWAP): Add parenthesis to avoid warnings.
Patches by Alan Modra.
$(objpfx) directories, and get rid of vpath directives. The previous
arrangement resulted in files being written to the source directories
when run in a clean build. Find all .abilist files in $(..)abilist/.
(update-abi-%): Likewise.
(generated): Don't add .symlist files, they'll be intermediates.
* sysdeps/generic/init-first.c: Add a comment.
* elf/Makefile ($(objpfx)ld.so): Pass -z defs in link.
* scripts/gen-as-const.awk: Grok lone "--" as a separator between
#includes and expressions.
* scripts/merge-abilist.awk: Omit cpu-.*-os.*/modifier from merged
config list when it already contains cpu-.*-os.* without / part.
* Makerules (sed-remove-dotdot): New variable.
($(common-objpfx)%.make): Use it. Depend on $(before-compile).
($(common-objpfx)%.h $(common-objpfx)%.h.d): Likewise.
(check-abi-config): New variable, append /tls or /notls to the tuple.
(check-abi-%): Use that for -v config value.
Find .abilist files in abilist/libfoo.abilist, not in subdir.
* Rules: Move bits/stdio_lim.h generation rules to Makerules.
2003-01-11 Jim Meyering <jim@meyering.net>
* io/ftw.c [HAVE_CONFIG_H]: Include <config.h>.
[HAVE_SYS_PARAM_H || _LIBC]: Guard inclusion of <sys/param.h>.
Include <sys/stat.h>, not <include/sys/stat.h>, if !_LIBC.
[!_LIBC] (__chdir, __closedir, __fchdir, __getcwd, __opendir): Define.
[!_LIBC] (__readdir64, __tdestroy, __tfind, __tsearch): Define.
[!_LIBC] (internal_function, dirent64, MAX): Define.
(__set_errno): Define if not already defined.
(open_dir_stream): When FTW_CHDIR is enabled, invoke opendir on
the basename, not the entire file name.
(process_entry): When FTW_CHDIR is enabled, invoke XSTAT or LXSTAT on
the basename, not the entire file name.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* string/tester.c (test_strcpy): Disable last added strcpy until
it is fixed.
2003-01-11 Philip Blundell <philb@gnu.org>
* sysdeps/unix/sysv/linux/arm/socket.S: Add cancellation support.
2003-01-11 Andreas Schwab <schwab@suse.de>
* Makerules: Add vpath for %.dynsym and %.so so that the
implicit rule chaining for check-abi works.
2003-01-11 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
Add non-PIC case.
2003-01-11 Jakub Jelinek <jakub@redhat.com>
* elf/tls-macros.h [__ia64__] (__TLS_CALL_CLOBBERS): Define.
[__ia64__] (TLS_LE, TLS_IE): Fix typos. Add ;; at start of asm if
gp is used early.
[__ia64__] (TLS_LD, TLS_GD): Likewise. Use __TLS_CALL_CLOBBERS.
* elf/Makefile ($(objpfx)tst-tlsmod5.so, $(objpfx)tst-tlsmod6.so):
Ensure libc.so in DT_NEEDED.
* sysdeps/alpha/dl-machine.h (elf_machine_rela): Move
CHECK_STATIC_TLS before l_tls_offset use.
* sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela):
Likewise.
* sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage) [TLS_DTV_AT_TP]:
Allocate TLS_PRE_TCB_SIZE bytes below result.
(_dl_deallocate_tls) [TLS_DTV_AT_TP]: Adjust before freeing.
* sysdeps/generic/libc-tls.c (__libc_setup_tls): If
TLS_INIT_TP_EXPENSIVE is not defined, allocate even if no PT_TLS
segment has been found. If TLS_DTV_AT_TP, allocate TLS_PRE_TCB_SIZE
bytes below result and add tcb_offset to memsz.
* sysdeps/ia64/dl-tls.h (__tls_get_addr): New prototype.
* sysdeps/ia64/dl-machine.h: Include tls.h.
(elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS relocs
too.
(elf_machine_rela): Assume if sym_map != NULL sym is non-NULL too.
Handle R_IA64_DTPMOD*, R_IA64_DTPREL* and R_IA64_TPREL* relocations.
* sysdeps/ia64/libc-tls.c: New file.
2003-01-10 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_RET): Add branch hit.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h (STAT_VER_LINUX):
Fix type. Move definition out of #if.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ftruncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Add cancellation
support.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Remove
ftruncate64, pread64, pwrite64, truncate64 entries.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
(INLINE_SYSCALL): New version that supports function call like
syscalls. Add __builtin_expect.
(LOADARGS_n): Add argument size safety checks.
(INTERNAL_SYSCALL): New Macro.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/truncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h [__PPC_ELF_H]: Avoid
redefinition of elf_fpreg_t and elf_fpregset_t.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Add several asserts. Correct and
simplify test for unloading. If loader of a DSO is unloaded do not
use its scope anymore. Fall back to own scope and adjust opencounts.
Fix several comments.
* elf/dl-deps.c (_dl_map_object_deps): Always allocate memory for
the l_searchlist, not only for l_initfini.
* elf/dl-lookup.c (add_dependencies): Avoid creating relocation
dependencies if objects cannot be removed. Remove object with the
definition as not unloadable if necessary.
* elf/reldep6.c: Create relocation dependency before closing the first
module.
2003-01-10 Guido Gnther <agx@sigxcpu.org>
* elf/Makefile: Add rules to build and run reldep9 test.
* elf/reldep9.c: New file.
* elf/reldep9mod1.c: New file.
* elf/reldep9mod2.c: New file.
* elf/reldep9mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile: Add rules to build and run nodelete2 test.
* elf/nodelete2.c: New file.
* elf/nodel2mod1.c: New file.
* elf/nodel2mod2.c: New file.
* elf/nodel2mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
2002-12-30 Ulrich Drepper <drepper@redhat.com>
* elf/Makefile: Add rules to build and run reldep8 test.
* elf/reldep8.c: New file.
* elf/reldep8mod1.c: New file.
* elf/reldep8mod2.c: New file.
* elf/reldep8mod3.c: New file.
Contributed by Jakub Jelinek.
(free_mem): New function.
* posix/Makefile (tests): Add bug-regex14. Add bug-regex14-mem
if not cross compiling.
(generated): Add bug-regex14-mem and bug-regex14.mtrace.
(bug-regex14-ENV): Set.
(bug-regex14-mem): New target.
* posix/bug-regex14.c: New file.
* elf/Makefile ($(objpfx)librtld.map): Use temporary file for output
target, so we don't touch it when the link fails.
changed from [USE_TLS && HAVE___THREAD].
* sysdeps/i386/dl-machine.h (elf_machine_type_class, elf_machine_rel):
Disable TLS relocs if [RTLD_BOOTSTRAP && !USE___THREAD].
* sysdeps/x86_64/dl-machine.h
(elf_machine_type_class, elf_machine_rela): Likewise.
* sysdeps/sh/dl-machine.h (elf_machine_type_class, elf_machine_rela):
Likewise.
* include/link.h (struct link_map): Remove member l_tls_tp_initialized.
* elf/rtld.c (_dl_start_final, dl_main): Don't use it.
(_dl_start): Conditionalize PT_TLS check on [USE___THREAD].
* sysdeps/i386/dl-tls.h (__TLS_GET_ADDR): Use ___tls_get_addr_internal
instead of ___tls_get_addr.
(___tls_get_addr_internal): Add attribute_hidden to decl.
* sysdeps/generic/ldsodefs.h (struct rtld_global): New variable
_dl_error_catch_tsd.
* elf/rtld.c (startup_error_tsd): New function.
(dl_main): Point _dl_error_catch_tsd at that.
* elf/dl-error.c: Don't use libc-tsd.h for DL_ERROR,
use new function pointer instead.
* elf/dl-tsd.c: New file.
* elf/Makefile (routines): Add it.
2002-10-07 Roland McGrath <roland@redhat.com>
* elf/dl-misc.c (_dl_debug_vdprintf): Use INTERNAL_SYSCALL macro for
writev if it's available. Otherwise if [RTLD_PRIVATE_ERRNO] then
take _dl_load_lock around calling __writev.
* sysdeps/unix/sysv/linux/i386/sysdep.h (INTERNAL_SYSCALL): New macro.
(INLINE_SYSCALL): Use that.
* sysdeps/generic/dl-sysdep.h: New file.
* sysdeps/mach/hurd/dl-sysdep.h: New file.
* sysdeps/generic/ldsodefs.h: Include <dl-sysdep.h>.
* include/errno.h [IS_IN_rtld]: Include <dl-sysdep.h> to define ...
[RTLD_PRIVATE_ERRNO]: Use a hidden global variable for errno and
access it directly.
* elf/dl-minimal.c (__errno_location): Removed.
* sysdeps/unix/i386/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]:
Use GOTOFF access for errno.
* sysdeps/unix/sysv/linux/i386/sysdep.h
[RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise.
* sysdeps/unix/x86_64/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]:
Use PC-relative access for errno.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h
[RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise.
* include/tls.h: New file.
(USE___THREAD): New macro.
Define to 1 under [USE_TLS && HAVE___THREAD] and only when compiling
libc or libpthread.
* sysdeps/unix/sysv/linux/i386/sysdep.h [USE___THREAD]: Conditional
changed from [USE_TLS && HAVE___THREAD].
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/i386/sysdep.S: Likewise.
* sysdeps/unix/x86_64/sysdep.S: Likewise.
* include/errno.h: Likewise.
* include/netdb.h: Likewise.
* include/resolv.h: Likewise.
* sysdeps/generic/errno.c: New file.
* csu/Makefile (aux): New variable, list errno.
* sysdeps/unix/sysv/linux/i386/sysdep.S (errno, _errno): Remove defns.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/arm/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/cris/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/powerpc/sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/sparc/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep.S: Likewise.
* sysdeps/unix/alpha/sysdep.S: Likewise.
* sysdeps/generic/start.c: Likewise.
* sysdeps/unix/start.c: Likewise.
* sysdeps/unix/arm/start.c: Likewise.
* sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise.
* sysdeps/unix/sparc/start.c: Likewise.
* sysdeps/unix/sysv/irix4/start.c: Likewise.
* sysdeps/unix/sysv/linux/mips/sysdep.S: File removed.
* manual/search.texi (Tree Search Function, Hash Search Function):
Mention search.h clearly.
2002-10-05 Roland McGrath <roland@redhat.com>
* elf/dl-fxstat64.c: File removed.
* elf/dl-xstat64.c: File removed.
* elf/Makefile (rtld-routines): Remove them.
* sysdeps/unix/sysv/linux/xstat64.c: Remove RTLD_STAT64 conditionals.
Instead, use strong_alias instead of versioned_symbol in the
!SHLIB_COMPAT case.
* sysdeps/unix/sysv/linux/fxstat64.c: Likewise.
* sysdeps/unix/sysv/linux/lxstat64.c: Likewise.
* include/shlib-compat.h
(SHLIB_COMPAT): Require that IS_IN_##lib be defined nonzero.
[! NOT_IN_libc] (IS_IN_libc): Define it.
* cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Use -Dx=1 not just -Dx.
* elf/Makefile (CPPFLAGS-.os): Likewise.
* sunrpc/rpc_main.c (main): Don't declare with noreturn attribute.
Return the status instead of calling exit.
* Makeconfig (CFLAGS): Prepend -std=gnu99.
* Makerules (+make-deps): Use $(CFLAGS) only for .c sources.
Remove superfluous rm command, whose @ plus make bugs hid
all these commands from the make output.
* include/stubs-prologue.h: New file. Give #error under #ifdef _LIBC.
* Makefile ($(inst_includedir)/gnu/stubs.h): Depend on it.
Use that file's contents instead of literal echo's for the prologue.
* include/features.h: Include <gnu/stubs.h> unconditionally.
* include/gnu/stubs.h: New file.
2002-09-30 Roland McGrath <roland@redhat.com>
* elf/rtld-Rules: New file.
* elf/Makefile ($(objpfx)librtld.map, $(objpfx)librtld.mk,
$(objpfx)rtld-libc.a): New targets.
(generated): Add them.
(reloc-link): Remove -o $@ from the variable.
($(objpfx)dl-allobjs.os): Add -o $@ after $(reloc-link).
(distribute): Add rtld-Rules.
(CPPFLAGS-.os): Define this instead of CFLAGS-.os.
* Makerules ($(+sysdir_pfx)sysd-rules): Emit rules for rtld-% targets.
(common-mostlyclean, common-clean): Clean up rtld-* files.
* sysdeps/unix/make-syscalls.sh: Add rtld-*.os target name to rules.
partially overlapping mappings. Remove unneeded (char *) casts.
Never allow duplication of ranges in mapped areas.
2002-08-20 Roland McGrath <roland@redhat.com>
* elf/Makefile ($(objpfx)ld.so): Separate commands in rule so errors
can be detected by make. Reported by H.J. Lu <hjl@gnu.org>.
(dl_main): Pass extra argument 0 to TLS_INIT_TP.
* elf/Makefile (test-srcs): Add $(modules-names) to it.
(CFLAGS-vismod2.c, CFLAGS-failobj.c, CFLAGS-constload2.c,
CFLAGS-reldepmod3.c, CFLAGS-reldepmod4.c, CFLAGS-ltglobmod2.c): Remove
all these variables.
2002-06-30 Ulrich Drepper <drepper@redhat.com>
* elf/dl-lookup.c (add_dependency): It is not necessary to add
dependencies if they are created between objects which are created
while processing RTLD_NOW for objects loaded as part of the same
dlopen call.
2002-06-14 H.J. Lu <hjl@gnu.org>
* elf/Makefile (tests): Add circleload1.
(modules-names): Add circlemod1, circlemod2, circlemod3,
circlemod1a, circlemod2a and circlemod3a.
($(objpfx)circleload1): New target.
($(objpfx)circleload1.out): Likewise.
($(objpfx)circlemod1.so): Likewise.
($(objpfx)circlemod2.so): Likewise.
($(objpfx)circlemod1a.so): Likewise.
($(objpfx)circlemod2a.so): Likewise.
* elf/circleload1.c: New file.
* elf/circlemod1.c: New file.
* elf/circlemod1a.c: New file.
* elf/circlemod2.c: New file.
* elf/circlemod2a.c: New file.
* elf/circlemod3.c: New file.
* elf/circlemod3a.c: New file.
2002-02-17 Andreas Schwab <schwab@suse.de>
* reldep7.c: New file.
* reldep7mod1.c: New file.
* reldep7mod2.c: New file.
* Makefile: Add rules to build and run reldep7.
2002-04-08 Ulrich Drepper <drepper@redhat.com>
* cppflags-iterator.mk (cpp-srcs-left): Define NOT_IN_libc instead
of NOT_IN_LIBC.
* include/libintl.h: Test for NOT_IN_libc not NOT_IN_LIBC.
* include/stdlib.h: Likewise.
2002-04-08 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile (CFLAGS-.os): Define NOT_IN_libc and IS_IN_rtld
instead of _RTLD_LOCAL.
* elf/dl-dst.h: Use IS_IN_rtld instead of _RTLD_LOCAL.
* include/unistd.h: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* stdio-common/_itoa.h (_itoa_word): Only use internal digit arrays
if in libc or ld.so.
* include/stdlib.h: For libc itself replace MB_CUR_MAX definition
with one accessing the locale data structures directly.
* stdio-common/printf-prs.c: Include localeinfo.h for new
MB_CUR_MAX definition.
* elf/dl-close.c (remove_slotinfo): New function. Handles everything
for removing reference of module in slotinfo list.
(_dl_close): Use remove_slotinfo.
* sysdeps/generic/dl-tls.c: General pretty printing.
(oom): Define only if SHARED.
(_dl_next_tls_modid): Correct starting point for the case we assume
there is a gap. Add missing instruction grouping (doh!). Correct
tests for reaching maximum index.
* elf/Makefile: Add rules to build and run tst-tls7.
* elf/tst-tls7.c: New file.
* elf/tst-tlsmod3.c: New file.
* elf/tst-tlsmod1.c: Move #include "tls-macros.h" instead #ifdef
USE_TLS.
* elf/tst-tlsmod2.c: Likewise.
* elf/dl-close.c (_dl_close): When closing an object using TLS
either decrement dl_tls_max_dtv_idx or set dl_tls_dtv_gaps to
true. Increment dl_tls_generation only if we closed any TLS-using
object.
* elf/tst-tls6.c: New file.
* elf/Makefile: Add rules to build and run tst-tls6.
2002-02-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/dl-tls.c (TLS_DTV_UNALLOCATED): Renamed from
TLS_DTV_UNALLOCATE.
(oom): New function.
(_dl_next_tls_modid): Rewrite to handle dl_tls_dtv_slotinfo_list.
(_dl_determine_tlsoffset): Likewise.
(_dl_allocate_tls): Likewise.
(__TLS_GET_ADDR): Define if not already defined.
(_dl_tls_symaddr): New function.
(allocate_and_init): New function.
(__tls_get_addr): Actually implement handling of generation counter
and deferred allocation.
* sysdeps/generic/ldsodefs.h (_rtld_global): Remove _dl_initimage_list,
add _dl_tls_dtv_slotinfo_list, _dl_tls_static_nelem, and
_dl_tls_generation.
Define TLS_SLOTINFO_SURPLUS and DTV_SURPLUS.
Declare _dl_tls_symaddr.
* sysdeps/i386/dl-tls.h: Disable __tls_get_addr handling unless
SHARED.
* include/link.h (struct link_map): Remove l_tls_nextimage and
l_tls_previmage.
* elf/dl-sym.c (_dl_sym): After successful lookup call _dl_tls_symaddr
instead of DL_SYMBOL_ADDRESS for STT_TLS symbols.
(_dl_vsym): Likewise.
* elf/rtld.c (_dl_start_final): Adjust initdtv initialization for new
layout.
(dl_main): Allow PT_TLS be present for empty segment. Remove
nextimage list handling. Instead add all modules using TLS to
dl_tls_dtv_slotinfo_list.
* elf/dl-open.c (dl_open_worker): After successfully loading all
objects add those with TLS to the dl_tls_dtv_slotinfo_list list.
* elf/dl-load.c (_dl_map_object_from_fd): If PT_TLS entry is for an
empty segment don't do anything. Remove handling of initimage list.
* elf/Versions [ld] (GLIBC_2.0): Add __libc_memalign.
(GLIBC_PRIVATE): Add _dl_tls_symaddr.
* elf/dl-minimal.c: Define __libc_memalign.
* elf/dl-support.c: Remove _dl_initimage_list. Add
_dl_tls_dtv_slotinfo_list, _dl_tls_static_nelem, and
_dl_tls_generation.
* include/stdlib.h: Declare __libc_memalign.
* elf/Makefile: Add rules to build and run tst-tls4 and tst-tls5.
* elf/tst-tls4.c: New file.
* elf/tst-tls5.c: New file.
* elf/tst-tlsmod2.c: New file.
* elf/tls-macros.h: asms using ___tls_get_addr destroy %ecx and %edx.
* elf/tst-tlsmod1.c: Don't define variables unles USE_TLS.
* elf/tst-tls1.c: Use test-skeleton.c.
* elf/tst-tls2.c: Likewise.
* elf/tst-tls3.c: Likewise.
* elf/dl-conflict.c (RESOLVE_MAP): Return NULL not 0.
* sysdeps/mips/machine-gmon.h: Update MCOUNT for current GCC behavior.
* elf/tst-tls3.c: New file.
* elf/tst-tlsmod1.c: New file.
* elf/Makefile: Add rules to build and run tst-tls3.
* sysdeps/i386/dl-machine.h: Include <tls.h>.
(elf_machine_type_class): Set ELF_RTYPE_CLASS_PLT also for the three
TLS relocations.
* elf/dl-deps.c (struct openaux_args): Add open_mode element.
(openaux): Pass open_mode as new last argument to _dl_map_object.
(_dl_map_object_deps): Add new argument open_mode. Initialize
open_mode element of args variable with it.
* elf/dl-open.c (dl_open_worker): Pass __RTLD_DLOPEN flag is set to
_dl_map_object_deps.
* elf/rtld.c (dl_main): Add zero as last parameter to
_dl_map_object_deps call.
* sysdeps/generic/ldsodefs.h: Adjust prototype of _dl_map_object_deps.
* elf/nodlopen2.c: New file.
* elf/nodlopenmod2.c: New file.
* elf/Makefile: Add rules to build and run nodlopen2.
* elf/tls-macros.hgg: ...here. New file.
2002-02-08 Richard Henderson <rth@redhat.com>
* elf/Makefile (tests): Add tst-tls1.
* elf/tst-tls1.c: New file.
* sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Don't handle
alignment of TCB for now.
* elf/rtld.c (dl_main): Use p_vaddr as address of TLS
initialization image for the application itself.
loop to initialize TLS block.
* elf/rtld.c (_dl_start_final): Allocate TLS and initialize
thread-pointer as soon as possible.
* sysdeps/generic/ldsodefs.h: Include <tls.h>. Define first TLS
elements in rtld_global.
* sysdeps/generic/tls.h: New file.
* elf/Makefile (distribute): Add tls.h.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Add support for TLS
relocations. Not complete yet.
* resolv/resolv.h: Allow user to define __need_res_state and only
define __res_start structure then.
* include/resolv.h: Only declare functions if _RESOLV_H_ is defined.
2001-12-11 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile (dl-routines): Add conflict.
(rtld-ldscript-in, rtld-ldscript, rtld-parms): Remove.
(ld.so): Add _begin local symbol.
* elf/elf.h (DT_VALTAGIDX, DT_VALNUM, DT_ADDRTAGIDX, DT_ADDRNUM):
Define.
* elf/dl-deps.c (_dl_build_local_scope): New.
(_dl_map_object_deps): If LD_TRACE_PRELINKING, compute local scopes
of all libraries.
* elf/do-rel.h (VALIDX): Define.
(elf_dynamic_do_rel): If ELF_MACHINE_PLT_REL is defined, don't do
lazy binding for RELA. If DT_GNU_PRELINKED, DT_RELACOUNT relocations
can be skipped.
* elf/dl-conflict.c: New file.
* elf/dl-lookup.c (_dl_debug_bindings): New.
(_dl_lookup_symbol): Use _dl_debug_bindings. Reference_name is always
non-NULL.
(_dl_lookup_symbol_skip): Likewise.
(_dl_lookup_versioned_symbol): Likewise.
(_dl_lookup_versioned_symbol_skip): Likewise.
* elf/dl-runtime.c (PLTREL): If ELF_MACHINE_PLT_REL is defined,
define to ElfW(Rel).
* elf/dynamic-link.h (elf_get_dynamic_info): Record selected dynamic
tags in the DT_VALRNGLO..DT_VALRNGHI and DT_ADDRRNGLO..DT_ADDRRNGHI
ranges.
Don't adjust address dynamic tags if l_addr is 0.
* elf/rtld.c (_dl_trace_prelink, _dl_trace_prelink_map): New variables.
(_dl_start): Skip ELF_DYNAMIC_RELOCATE if ld.so is prelinked.
(VALIDX, ADDRIDX): Define.
(_dl_start_final): Initialize _dl_rtld_map's l_map_start and l_map_end.
(dl_main): Print library list for LD_TRACE_PRELINKING.
If prelinking information can be used, skip relocating libraries and
call _dl_resolve_conflicts instead.
(process_envvars): Handle LD_TRACE_PRELINKING envvar.
* elf/dl-load.c (_dl_map_object): Don't create fake libs
if LD_TRACE_PRELINKING.
* include/link.h (struct link_map) [l_info]: Add DT_VALNUM
+ DT_ADDRNUM.
* sysdeps/generic/ldsodefs.h (_dl_trace_prelink_map): New declaration.
(DL_DEBUG_PRELINK): Define.
(_dl_resolve_conflicts): Add prototype.
* sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): Reinitialize
.plt for prelinked libraries where prelinking info cannot be used.
(elf_machine_rela): If relocating R_ALPHA_JMP_SLOT in .gnu.conflict
section, use RESOLVE_CONFLICT_FIND_MAP to find out reloc's link_map.
* sysdeps/arm/bits/link.h: New file.
* sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP.
(ELF_MACHINE_PLT_REL): Define.
(elf_machine_rela, elf_machine_rela_relative): New.
(elf_machine_lazy_rel): Reinitialize R_ARM_JUMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/i386/bits/link.h: New file.
* sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP.
(ELF_MACHINE_PLT_REL): Define.
(elf_machine_rela, elf_machine_rela_relative): New.
(elf_machine_lazy_rel): Reinitialize R_386_JUMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/powerpc/dl-machine.h (elf_machine_rela): If relocating
conflicts, skip finaladdr computation. Use RESOLVE_CONFLICT_FIND_MAP
to find out map for R_PPC_JMP_SLOT relocs.
* sysdeps/sparc/sparc32/dl-machine.h (VALIDX): Define.
(OPCODE_BA): Define.
(elf_machine_runtime_setup): Reinitialize .plt for prelinked
libraries where prelinking info cannot be used.
(sparc_fixup_plt): Renamed from elf_machine_fixup_plt.
(elf_machine_fixup_plt): Call sparc_fixup_plt.
(elf_machine_rela): Set value to 0 if relocating conflicts.
Call sparc_fixup_plt for R_SPARC_JMP_SLOT.
* sysdeps/sparc/sparc64/dl-machine.h (VALIDX): Define.
(sparc64_fixup_plt): Fix a typo.
(elf_machine_rela): Set value to 0 if relocating conflicts.
Handle R_SPARC_JMP_SLOT relocs when relocating conflicts.
(elf_machine_runtime_setup): Reinitialize .plt for prelinked
libraries where prelinking info cannot be used.
* sysdeps/sh/bits/link.h: New file.
* sysdeps/sh/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_SH_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/s390/s390-32/bits/link.h: New file.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/s390/s390-64/bits/link.h: New file.
* sysdeps/s390/s390-64/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/x86_64/bits/link.h: New file.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_X86_64_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
2001-09-29 Jes Sorensen <jes@trained-monkey.org>
* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h (struct sigcontext):
Add sc_loadrs and sc_rbs_bas to match current kernel.
2001-09-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc64/fpu/libm-test-ulps: Update.
* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfcl): Fix erfc(-inf).
2001-09-27 Jakub Jelinek <jakub@redhat.com>
* elf/dl-open.c (dl_open_worker): If l_opencount of freshly loaded
object has been bumped because of relocation dependency, avoid
duplicates in l_scope.
(show_scope): Fix typos.
* elf/Makefile: Add rules to build and run reldep6.
* elf/reldep6.c: New file.
* elf/reldep6mod0.c: New file.
* elf/reldep6mod1.c: New file.
* elf/reldep6mod2.c: New file.
* elf/reldep6mod3.c: New file.
* elf/reldep6mod4.c: New file.
2001-09-26 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Call
sparc64_fixup_plt.
(sparc64_fixup_plt): Moved from elf_machine_fixup_plt. Optimize
near jumps and 0xfffff800XXXXXXXX target addresses, no thread safety
for non-lazy binding. Fix .plt[32768+] handling.
(elf_machine_plt_value): Don't add addend.
(elf_machine_rela): Call sparc64_fixup_plt instead of
elf_machine_fixup_plt.
(elf_machine_runtime_setup, TRAMPOLINE_TEMPLATE): Optimize for
dynamic linker at 0xfffff800XXXXXXXX.
* sysdeps/sparc/sparc32/fpu/libm-test-ulps: Update.
2001-09-08 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): If object has no r_list (i.e., wasn't
loaded directly) determine length if l_initfini list by iterating
over its elements. Minor optimizations.
* elf/dl-deps.c (_dl_map_object_deps): Always add own map to l_initfini
for dependency objects.
If object was already loaded check whether any of the dependencies
is already on the relocation dependency list. If yes, remove the
latter. Minor optimizations.
* elf/dl-lookup.c (add_dependency): Add check for self reference of
maps here. Search l_initfini list only if the object was loaded
directly and not only as a dependency.
(_dl_lookup_symbol): Add relocation dependency also if object
is not in global scope. Remove test for self-reference here.
(_dl_lookup_versioned_symbol): Likewise.
* elf/dl-object (_dl_new_object): Cleanup. Initialize dont_free
element of first name record.
* elf/loadtest.c: Add some more test to recognize early if an object
wasn't unloaded.
* elf/Makefile: Add rules to build and run reldep5.
* elf/reldep5.c: New file.
* elf/reldepmod5.c: New file.
* elf/reldepmod6.c: New file.
* elf/reldep2.c: Fix typo.
* elf/dl-object.c (_dl_new_object): Initialize l_scope and l_scope_max.
2001-09-07 Ulrich Drepper <drepper@redhat.com>
* include/link.h (struct link_map): Add l_scope_mem and l_scope_max
elements. Change l_scope to be a pointer only.
* elf/dl-object.c (_dl_new_ojbect): Initialize l_scope and l_scope_max.
* elf/dl-open.c (dl_open_worker): If dependency wasn't just opened
here add searchlist of newly open file to the dependency's scope.
* elf/dl-close.c (_dl_close): If dependency is used otherwise remove
only searchlist from its scope. Free own scope array if necessary.
* elf/Makefile (tests): Add dblload and dblunload now.
2001-09-05 Ulrich Drepper <drepper@redhat.com>
* elf/Makefile: Add rules to build new tests. Don't run them yet since
they both fail.
* elf/dblload.c: New file.
* elf/dblloadmod1.c: New file.
* elf/dblloadmod2.c: New file.
* elf/dblloadmod3.c: New file.
* elf/dblunload.c: New file.
2001-08-29 Ulrich Drepper <drepper@redhat.com>
* nis/nis_findserv.c (__nis_findfastest): Don't fail if reply received
first is from a previous call.
Patch by Alexander Belopolsky <alexb@rentec.com> for [PR libc/3670].
2001-08-29 Andreas Schwab <schwab@suse.de>
* sysdeps/ia64/fpu/libm-test-ulps: Updated.
2001-08-25 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
* config.make.in (INSTALL_SCRIPT): Define.
* Makeconfig (INSTALL_SCRIPT): Define.
* Makerules (do-install-script): New macro to install scripts using
INSTALL_SCRIPT.
(install-bin-script): New rule to install scripts with
do-install-script.
(install-bin-script-nosubdir): New rule.
(install-no-libc.a-nosubdir): Add install-bin-script-nosubdir.
(distinfo-vars): Add $(install-bin-script).
* Rules (others): Likewise.
* Makefile (glibcbug): Install with install-bin-script.
* debug/Makefile (xtrace): Likewise.
(catchsegv): Likewise.
* elf/Makefile (ldd): Likewise.
* malloc/Makefile (mtrace): Likewise.
* timezone/Makefile (tzselect): Likewise.
2001-08-29 H.J. Lu <hjl@gnu.org>
* sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Pass
ELF_RTYPE_CLASS_PLT, instead of R_MIPS_REL32, to
_dl_lookup_versioned_symbol () and _dl_lookup_symbol ().
Add it to LDFLAGS.so, LDFLAGS-rtld, and +link.
2001-07-06 Paul Eggert <eggert@twinsun.com>
* manual/argp.texi: Remove ignored LGPL copyright notice; it's
not appropriate for documentation anyway.
* manual/libc-texinfo.sh: "Library General Public License" ->
"Lesser General Public License".
2001-07-06 Andreas Jaeger <aj@suse.de>
* All files under GPL/LGPL version 2: Place under LGPL version
2.1.
2001-05-20 Bruno Haible <haible@clisp.cons.org>
* iconvdata/cp1255.c: Completely rewritten.
* iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255.
* iconvdata/testdata/WINDOWS-1255: New file.
* iconvdata/testdata/WINDOWS-1255..UTF8: New file.
* iconvdata/TESTS: Add WINDOWS-1255 test.
* iconvdata/CP1255.irreversible: New file.
2001-05-20 Bruno Haible <haible@clisp.cons.org>
* iconvdata/cp1258.c: Completely rewritten.
* iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258.
* iconvdata/testdata/WINDOWS-1258: New file.
* iconvdata/testdata/WINDOWS-1258..UTF8: New file.
* iconvdata/TESTS: Add WINDOWS-1258 test.
* iconvdata/tst-table-from.c (try): Reset the iconv descriptor before
the main call, and flush it afterwards.
(utf8_decode): Return a string, possibly containing several Unicode
characters.
(main): Update all utf8_decode calls.
* iconvdata/CP1258.irreversible: New file.
2001-05-20 Bruno Haible <haible@clisp.cons.org>
* iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2.
* iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the
first case, set outbuf, outstart, outend, and call PREPARE_LOOP before
EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to
the next step. In the second case, clear the state without calling
EMIT_SHIFT_TO_INIT.
* iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of
data->__outbuf, and outend instead of data->__outbufend.
* iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise.
* iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise.
2001-05-21 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): Compute l_map_end for the main program.
* elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0.
If match == _dl_loaded, caller can still come from the main program.
(_dl_vsym): Likewise.
* elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0.
* elf/dl-error.c (_dl_signal_error): Change NULL objname into "".
* elf/restest2.c: New test.
* elf/Makefile (tests): Add restest2.
(restest2, LDFLAGS-restest2): Add rules.
2001-03-12 Jakub Jelinek <jakub@redhat.com>
* csu/Makefile (abi-tag.h): Define OS and version separately, allow
version to be overriden from config.h.
* csu/abi-note.S: Use OS and version separately, include config.h.
* elf/dl-load.c (_dl_osversion): New.
(_dl_map_object_from_fd): Kill some warnings.
(open_verify): Check .note.ABI-tag of the library if present.
* elf/Makefile (CPPFLAGS-dl-load.c): Add -I$(csu-objpfx).
* elf/cache.c (struct cache_entry): Add osversion.
(print_entry): Print osversion.
(print_cache): Pass osversion to it.
(compare): Sort according to osversion.
(save_cache): Set osversion.
(add_to_cache): Add osversion argument.
* sysdeps/generic/ldconfig.h (add_to_cache, process_file,
process_elf_file): Add osversion argument.
* elf/readlib.c (process_file): Likewise.
* sysdeps/generic/readelflib.c (process_elf_file): Likewise.
* sysdeps/unix/sysv/linux/ia64/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* sysdeps/unix/sysv/linux/i386/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* sysdeps/unix/sysv/linux/sparc/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* elf/ldconfig.c (manual_link): Pass it.
(search_dir): Issue diagnostic if two libs with the same soname in
the same directory have different .note.ABI-tag. Record osversion in
dlib_entry and use it from there.
(struct lib_entry): Remove.
(struct dlib_entry): Add osversion.
* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Check
osversion.
* sysdeps/generic/dl-cache.h (struct file_entry_new): Replace __unused
field with osversion.
* sysdeps/generic/ldsodefs.h (_dl_osversion): Declare.
* sysdeps/unix/sysv/linux/init-first.c: Include ldsodefs.h.
* sysdeps/unix/sysv/linux/dl-osinfo.h (DL_SYSDEP_OSCHECK): Save kernel
version in _dl_osversion.
* sysdeps/unix/sysv/linux/configure.in: Define __ABI_TAG_VERSION.
* Makerules (build-shlib-helper, build-module-helper): New.
(build-shlib, build-module-helper): Make sure .note.ABI-tag comes
early.
* config.h.in (__ABI_TAG_VERSION): Add.
* elf/dl-minimal.c (__strtoul_internal): Set endptr on return.
* sysdeps/unix/sysv/linux/i386/dl-librecon.h (EXTRA_LD_ENVVARS):
Handle LD_ASSUME_KERNEL.
* sysdeps/unix/sysv/linux/dl-librecon.h: New.
* stdlib/Makefile (tests): Don't run tst-fmtmsg when
cross-compiling.
($(objpfx)tst-fmtmsg.out): Pass run-program-prefix.
* stdlib/tst-fmtmsg.sh (test): Use run_program_prefix for static
only builds.
* elf/Makefile (tests): Only run tst-pathopt with shared libs.
2000-12-30 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): We can ignore the NODELETE flag if the
object was not yet initialized.
2000-12-28 H.J. Lu <hjl@gnu.org>
* elf/dl-deps.c (_dl_map_object_deps): Make sure the DSO state
is always consistent even if its dependency is failed.
* elf/dl-open.c (_dl_open): Increment the open count before
calling _dl_close () in case of failure.
* elf/neededtest4.c: New file.
* elf/neededobj5.c: New file.
* elf/neededobj6.c: New file.
* elf/Makefile (distribute): Add neededobj5.c and neededobj6.c.
(tests): Add neededtest4.
(modules-names): Add neededobj5 and neededobj6.
($(objpfx)neededobj6.so): New target.
($(objpfx)neededtest4): New target.
($(objpfx)neededtest4.out): New target.
* elf/dl-lookup.c (add_dependency): Fix test to check whether
dependency already exists.
* elf/Makefile: Add testobj1 and testobj2 as dependencies of testobj6.
* elf/loadtest.c (main): Add test at the end that everything is
unloaded.
* elf/dl-open.c (dl_open_worker): Fix typo in comment.
2000-10-24 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Use correct list (l_initfini) when
computing new opencounts.
* elf/Makefile: Add rules to build and run neededtest3.
* neededtest3.c: New file.
* neededobj4.c: New file.
* elf/neededtest.c (main): Correct tests for failing dlopen.
* elf/unload.c: Generate more debugging output.
* elf/neededtest.c: Make it more complicated.
* elf/neededtest2.c: New file.
* elf/Makefile: Add rules to build and run neededtest2.
2000-10-21 Ulrich Drepper <drepper@redhat.com>
* elf/dl-open.c (add_to_global): New function. Split out from
dl_open_worker.
(dl_open_worker): Call add_to_global not only for new objects, also for
previously loaded objects when (mode & RTLD_GLOBAL) and the object
was not yet in the global scope.
* elf/Makefile: Add rules to build and run lateglobal.
* elf/lateglobal.c: New file.
* elf/ltglobmod1.c: New file.
* elf/ltglobmod2.c: New file.
2000-10-19 H.J. Lu <hjl@gnu.org>
* elf/Makefile (distribute): Add neededtest.c, neededobj1.c,
neededobj2.c and neededobj3.c.
(tests): Add neededtest.
(modules-names): Add neededobj1, neededobj2 and neededobj3.
($(objpfx)neededobj1.so): New target.
($(objpfx)neededobj2.so): Likewise.
($(objpfx)neededobj3.so): Likewise.
($(objpfx)neededtest): Likewise.
($(objpfx)neededtest.out): Likewise.
* elf/neededtest.c: New. Based on the bug report from
Allen Bauer <kylix_rd@hotmail.com>.
* elf/neededobj1.c: Likewise.
* elf/neededobj2.c: Likewise.
* elf/neededobj3.c: Likewise.
2000-10-20 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Decrement reference counter for all
dependencies even if the DSO does not get unloaded.
* elf/dl-load.c (_dl_map_object_from_fd): Pass pointer to ELF header
to elf_machine_matches_host.
* sysdeps/alpha/dl-machine.h (elf_machine_matches_host): Parameter
is now pointer to ELF header.
* sysdeps/arm/dl-machine.h: Likewise.
* sysdeps/generic/dl-machine.h: Likewise.
* sysdeps/hppa/dl-machine.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/m68k/dl-machine.h: Likewise.
* sysdeps/mips/dl-machine.h: Likewise.
* sysdeps/mips/mips64/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.h: Likewise.
* sysdeps/s390/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
Patch by Martin Schwidefsksy <schwidefsky@de.ibm.com>.
2000-10-20 Jakub Jelinek <jakub@redhat.com>
* include/limits.h: Include bits/wordsize.h, use #if __WORDSIZE == 64
check instead of #ifdef __alpha__.
* include/bits/xopen_lim.h (WORD_BIT, LONG_BIT): Don't count on
INT_MAX, __INT_MAX__, LONG_MAX or __LONG_MAX__ being defined when
this is included.
* posix/wordexp-tst.sh (testout): Place output file in build
directory. Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
2000-09-29 Ulrich Drepper <drepper@redhat.com>
* elf/chroot_canon.c: Don't report a failure if the last path
component is not available.
* elf/ldconfig.c (parse_conf): Use canonicalized name when reporting
error.
* elf/cache.c (print_cache): Use stat64 instead of stat.
* elf/ldconfig.c (chroot_stat): Likewise.
(create_links): Likewise.
(manual_link): Likewise.
(search_dir): Likewise.
* elf/readlib.c (process_file): Likewise.
* Makefile (install): Set LC_ALL and LANGUAGE to C before running
ldconfig.
2000-09-29 Jakub Jelinek <jakub@redhat.com>
* elf/chroot_canon.c: New file.
* elf/Makefile: Build and distribute it.
* elf/ldconfig.h (process_file): Add real_file_name argument.
(chroot_canon): Add prototype.
* elf/ldconfig.c (cache_file): Remove const.
(chroot_stat): New.
(create_links): Add real_path argument.
If opt_chroot, maintain both real and given filenames.
(manual_link): Likewise.
(search_dir): Likewise.
(parse_conf): If opt_chroot, use chroot_canon to find the real
config file.
(main): For -r, try to use chroot, if it fails, leave opt_chroot set
and use chroot_canon where appropriate to do the same as if chroot
succeeded.
* elf/readlib.c (process_file): Add real_file_name argument, pass it
to fopen.
2000-09-29 Ulrich Drepper <drepper@redhat.com>
* math/complex.h (_Complex): We can be more specific when _Complex
is defined by the compiler.
2000-09-15 Ulrich Drepper <drepper@redhat.com>
* elf/Makefile (distribute): Add nextmod1.c and nextmod2.c.
(tests): Add next.
(modules-names): Add nextmod1 and nextmod2.
Add rules to build and run next.
* elf/next.c: New file.
* elf/nextmod1.c: New file.
* elf/nextmod2.c: New file.
2000-09-14 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (_dl_lookup_symbol_skip): Fix a typo.