about summary refs log tree commit diff
path: root/elf/dl-open.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * elf/dl-close.c (_dl_close_worker): Renamed from _dl_close andUlrich Drepper2006-10-271-1/+1
| | | | | | | | | | split out locking and parameter checking. (_dl_close): Call _dl_close_worker after locking and checking. * elf/dl-open.c (_dl_open): Call _dl_close_worker instead of _dl_close. we are sure we do not need it anymore for _dl_close. Also move * elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope
* [BZ #3429]Ulrich Drepper2006-10-271-10/+11
| | | | | | | | | 2006-10-27 Ulrich Drepper <drepper@redhat.com> [BZ #3429] * elf/dl-open.c (dl_open_worker): Keep holding dl_load_lock until we are sure we do not need it anymore for _dl_close. ALso move the asserts inside the lock region. Patch mostly by Suzuki <suzuki@in.ibm.com>.
* * elf/dl-lookup.c (_dl_debug_bindings): Remove unised symbol_scopeUlrich Drepper2006-10-271-36/+25
| | | | | | | | | | | | | | | | | | | | | | | | | argument. (_dl_lookup_symbol_x): Adjust caller. * sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove _ns_global_scope. * elf/rtld.c (dl_main): Don't initialize _ns_global_scope. * elf/dl-libc.c: Revert l_scope name changes. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * elf/dl-close.c (_dl_close): Likewise. * elf/dl-open.c (dl_open_worker): Likewise. If not SINGLE_THREAD_P, always use __rtld_mrlock_{change,done}. Always free old scope list here if not l_scope_mem. * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name change. Never free scope list here. Just __rtld_mrlock_lock before the lookup and __rtld_mrlock_unlock it after the lookup. * elf/dl-sym.c: Likewise. * include/link.h (struct r_scoperec): Remove. (struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem with l_scope_mem and l_scoperec_lock with l_scope_lock.
* [BZ #3313]Ulrich Drepper2006-10-181-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-10-17 Jakub Jelinek <jakub@redhat.com> * sunrpc/xdr_mem.c (xdrmem_setpos): Don't compare addresses as signed longs, check for x_base + pos overflow. * sunrpc/Makefile (tests): Add tst-xdrmem2. * sunrpc/tst-xdrmem2.c: New test. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to _dl_lookup_symbol_x code. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * elf/dl-runtime.c: Include sysdep-cancel.h. (_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-sym.c: Include sysdep-cancel.h. (do_sym): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-close.c: Include sysdep-cancel.h. (_dl_close): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-open.c: Include sysdep-cancel.h. (dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. 2006-10-17 Jakub Jelinek <jakub@redhat.com> [BZ #3313] * malloc/malloc.c (malloc_consolidate): Set maxfb to address of last fastbin rather than end of fastbin array. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct body macro. * sysdeps/x86_64/bits/atomic.h (__arch_c_compare_and_exchange_val_64_acq): Add missing casts. (catomic_decrement): Use correct body macro. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * include/atomic.h: Add a unique prefix to all local variables in macros. * csu/tst-atomic.c (do_test): Test also catomic_* macros. * include/link.h: Include <rtld-lowlevel.h>. Define struct
* * include/atomic.c: Define catomic_* operations.Ulrich Drepper2006-10-111-2/+2
| | | | | | | | | | | | | | * sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems. * stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*. * malloc/memusage.c: Likewise. * gmon/mcount.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-fptr.c: Likewise. * resolv/res_libc.c: Likewise.
* Jakub Jelinek <jakub@redhat.com>Ulrich Drepper2006-10-101-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement reference counting of scope records. * elf/dl-close.c (_dl_close): Remove all scopes from removed objects from the list in objects which remain. Always allocate new scope record. * elf/dl-open.c (dl_open_worker): When growing array for scopes, don't resize, allocate a new one. * elf/dl-runtime.c: Update reference counters before using a scope array. * elf/dl-sym.c: Likewise. * elf/dl-libc.c: Adjust for l_scope name change. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * include/link.h: Inlcude <rtld-lowlevel.h>. Define struct r_scoperec. Replace r_scope with pointer to r_scoperec structure. Add l_scoperec_lock. * sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>. * sysdeps/generic/rtld-lowlevel.h: New file. * include/atomic.h: Rename atomic_and to atomic_and_val and atomic_or to atomic_or_val. Define new macros atomic_and and atomic_or which do not return values. * sysdeps/x86_64/bits/atomic.h: Define atomic_and and atomic_or. Various cleanups. * sysdeps/i386/i486/bits/atomic.h: Likewise.
* * elf/dl-open.c (dl_open_worker): Allow $LIB and $PLATFORM inUlrich Drepper2006-08-281-7/+0
| | | | dlopen parameters.
* * elf/dl-open.c (dl_open_worker): Add branch prediction.Ulrich Drepper2006-07-311-2/+2
|
* * elf/dl-open.c [!SHARED]: Remove _dl_tls_static_size definition. cvs/fedora-glibc-20051115T0809Ulrich Drepper2005-11-151-6/+0
| | | | * sysdeps/generic/libc-tls.c: Initialize _dl_tls_static_size here.
* * elf/dl-error.c (_dl_signal_error): Store information about use ofUlrich Drepper2005-06-121-7/+8
| | | | | | | | | | | | | | | | | 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.
* * elf/dl-open.c (dl_open_worker): Fix typo.Ulrich Drepper2005-03-201-0/+2
|
* * elf/dl-open.c (dl_open_worker): Print exact l_direct_opencount value,Ulrich Drepper2005-03-191-1/+1
| | | | it has been incremented before.
* * include/link.h (struct link_map): Remove l_opencount. Add l_removed.Ulrich Drepper2005-03-181-101/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * elf/dl-close.c (_dl_close): Decrement l_opencount beforeUlrich Drepper2005-03-071-1/+1
| | | | | | printing debug message. * elf/dl-open.c (dl_open_worker): Always print the new opencount in debug messages.
* * sysdeps/generic/ldsodefs.h (_dl_out_of_memory_internal): Remove decl.Roland McGrath2005-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (_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).
* * elf/dl-load.c (_dl_map_object_from_fd): We don't have to allowUlrich Drepper2005-01-131-1/+1
| | | | | | | | | | | callers from libc anymore. * elf/dl-open.c (dl_open_worker): Pass __RTLD_AUDIT flag from caller to _dl_map_object_deps. * elf/dl-load.c (_dl_map_object_from_fd): Don't change memory protections when loading auditing modules. * dlfcn/dlopen.c (dlopen_doit): Catch invalid mode arguments and fail.
* Update.Ulrich Drepper2005-01-091-9/+9
| | | | | | | | | | | | | | | | | | 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.
* * csu/elf-init.c (__libc_csu_fini): Don't do anything here. Ulrich Drepper2005-01-061-127/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sysdeps/generic/libc-start.c: Don't register program destructor here. * dlfcn/Makefile: Add rules to build dlfcn.c. (LDFLAGS-dl.so): Removed. * dlfcn/dlclose.c: _dl_close is now in ld.so, use function pointer table. * dlfcn/dlmopen.c: Likewise for _dl_open. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * elf/dl-libc.c: Likewise for _dl_open and _dl_close. * elf/Makefile (routines): Remove dl-open and dl-close. (dl-routines): Add dl-open, dl-close, and dl-trampoline. Add rules to build and run tst-audit1. * elf/tst-audit1.c: New file. * elf/tst-auditmod1.c: New file. * elf/Versions [libc]: Remove _dl_open and _dl_close. * elf/dl-close.c: Change for use inside ld.so instead of libc.so. * elf/dl-open.c: Likewise. * elf/dl-debug.c (_dl_debug_initialize): Allow reinitialization, signaled by nonzero parameter. * elf/dl-init.c: Fix use of r_state. * elf/dl-load.c: Likewise. * elf/dl-close.c: Add auditing checkpoints. * elf/dl-open.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-sym.c: Likewise. * sysdeps/generic/libc-start.c: Likewise. * elf/dl-object.c: Allocate memory for auditing information. * elf/dl-reloc.c: Remove RESOLV. We now always need the map. Correctly initialize slotinfo. * elf/dynamic-link.h: Adjust after removal of RESOLV. * sysdeps/hppa/dl-lookupcfg.h: Likewise. * sysdeps/ia64/dl-lookupcfg.h: Likewise. * sysdeps/powerpc/powerpc64/dl-lookupcfg.h: Removed. * elf/dl-runtime.c (_dl_fixup): Little cleanup. (_dl_profile_fixup): New parameters to point to register struct and variable for frame size. Add auditing checkpoints. (_dl_call_pltexit): New function. Don't define trampoline code here. * elf/rtld.c: Recognize LD_AUDIT. Load modules on startup. Remove all the functions from _rtld_global_ro which only _dl_open and _dl_close needed. Add auditing checkpoints. * elf/link.h: Define symbols for auditing interfaces. * include/link.h: Likewise. * include/dlfcn.h: Define __RTLD_AUDIT. Remove prototypes for _dl_open and _dl_close. Adjust access to argc and argv in libdl. * dlfcn/dlfcn.c: New file. * sysdeps/generic/dl-lookupcfg.h: Remove all content now that RESOLVE is gone. * sysdeps/generic/ldsodefs.h: Add definitions for auditing interfaces. * sysdeps/generic/unsecvars.h: Add LD_AUDIT. * sysdeps/i386/dl-machine.h: Remove trampoline code here. Adjust for removal of RESOLVE. * sysdeps/x86_64/dl-machine.h: Likewise. * sysdeps/generic/dl-trampoline.c: New file. * sysdeps/i386/dl-trampoline.c: New file. * sysdeps/x86_64/dl-trampoline.c: New file. * sysdeps/generic/dl-tls.c: Cleanups. Fixup for dtv_t change. Fix updating of DTV. * sysdeps/generic/libc-tls.c: Likewise. * sysdeps/arm/bits/link.h: Renamed to ... * sysdeps/arm/buts/linkmap.h: ...this. * sysdeps/generic/bits/link.h: Renamed to... * sysdeps/generic/bits/linkmap.h: ...this. * sysdeps/hppa/bits/link.h: Renamed to... * sysdeps/hppa/bits/linkmap.h: ...this. * sysdeps/hppa/i386/link.h: Renamed to... * sysdeps/hppa/i386/linkmap.h: ...this. * sysdeps/hppa/ia64/link.h: Renamed to... * sysdeps/hppa/ia64/linkmap.h: ...this. * sysdeps/hppa/s390/link.h: Renamed to... * sysdeps/hppa/s390/linkmap.h: ...this. * sysdeps/hppa/sh/link.h: Renamed to... * sysdeps/hppa/sh/linkmap.h: ...this. * sysdeps/hppa/x86_64/link.h: Renamed to... * sysdeps/hppa/x86_64/linkmap.h: ...this. 2005-01-06 Ulrich Drepper <drepper@redhat.com> * allocatestack.c (init_one_static_tls): Adjust initialization of DTV 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. * 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.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-294/+261
|
* 2.5-18.1Jakub Jelinek2007-07-121-261/+294
|
* Update.Ulrich Drepper2004-10-281-1/+1
| | | | | | 2004-10-28 Ulrich Drepper <drepper@redhat.com> * elf/dl-open.c (dl_open_worker): Remove reference to glibcbug script.
* Update.Ulrich Drepper2004-10-271-0/+6
| | | | | | | | | | | | | | | | 2004-10-27 Jakub Jelinek <jakub@redhat.com> * include/resolv.h (_res_opcodes): New extern. Add libresolv_hidden_proto. * resolv/res_debug.c (_res_opcodes): Remove. (__p_class_syms, __p_type_syms): Add libresolv_hidden_proto and libresolv_hidden_data_def. Remove attribute_hidden. * resolv/res_mkquery (_res_opcodes): Remove. * resolv/res_data.c (_res_opcodes): Remove attribute_hidden. Add libresolv_hidden_data_def. * elf/dl-open.c (_dl_open): Don't allow explicitly opening a DSO into an empty namespace.
* (dl_open_worker): Avoid dereferencing map in statically linked code if there ↵Ulrich Drepper2004-10-181-1/+9
| | | | might none be found.
* [BZ #77]Ulrich Drepper2004-10-141-45/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update.Ulrich Drepper2004-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* [BZ #116]Ulrich Drepper2004-08-091-15/+27
| | | | | | | | | | | 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.Ulrich Drepper2004-07-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update.Ulrich Drepper2004-03-271-66/+2
| | | | | | | | | | | | | | | | | | | | 2004-03-26 Ulrich Drepper <drepper@redhat.com> * elf/dl-caller.c: New file. * include/caller.h: New file. * Makefile (distribute): Add include/caller.h. * elf/Makefile (dl-routines): Add dl-caller. * elf/dl-load.c (_dl_map_object_from_fd): Record l_text_end. * elf/dl-open.c (check_libc_caller): Removed. (dl_open_worker): Use __check_caller instead. * elf/rtld.c (_rtld_global_ro): Initialize _dl_check_caller. (_dl_start_final): Record l_text_end for ld.so map. (dl_main): Record l_text_end for main object and vdso. * include/link.h (struct link_map): Add l_text_end field. * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Add _dl_check_caller field. Define enum allowmask. Add declaration of _dl_check_caller. * sysdeps/unix/sysv/linux/dl-execstack.c: Also use __check_caller test.
* Update.Ulrich Drepper2004-03-261-1/+1
| | | | | | 2004-03-26 Ulrich Drepper <drepper@redhat.com> * elf/dl-open.c (check_libc_caller): Fix typo.
* Update.Ulrich Drepper2004-03-061-3/+2
| | | | | | | | | | | 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.
* Update.Ulrich Drepper2004-03-061-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elf/Versions: Remove functions which are not exported anymore. * dlfcn/dlerror.c: Call ld.so functions through GLSO. * dlfcn/dlinfo.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-libc.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-sym.c: Likewise. * sysdeps/generic/libc-start.c: Likewise. * elf/dl-debug.c: Remove *_internal definition. Don't use INTUSE for functions which are not exported anymore. * elf/dl-deps.c: Likewise. * elf/dl-dst.h: Likewise. * elf/dl-error.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-init.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-misc.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-profstub.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-lookup.h: Likewise. * include/dlfcn.h: Likewise. * sysdeps/generic/dl-cache.c: Likewise. * sysdeps/generic/dl-fptr.c: Likewise. * sysdeps/generic/dl-origin.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/generic/dl-tls.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/i386/dl-tls.h: Likewise. * sysdeps/unix/sysv/linux/dl-origin.c: Likewise. * elf/rtld.c: Likewise. Export function though _rtld_global_ro. * generic/dl-fptr.c: Likewise. * mach/hurd/dl-sysdep.c: Likewise. * unix/sysv/linux/ia64/dl-static.c: Likewise. * unix/sysv/linux/ia64/getpagesize.c: Likewise. * unix/sysv/linux/m68k/getpagesize.c: Likewise. * unix/sysv/linux/sparc/sparc32/getpagesize.c: Likewise.
* Update.Ulrich Drepper2004-03-051-5/+6
| | | | | | | | | | | | | * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h: Likewise. * sysdeps/powerpc/powerpc32/dl-machine.c: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/arm/dl-machine.h: Likewise. * sysdeps/alpha/dl-machine.h: Likewise.
* Update.Ulrich Drepper2004-03-051-2/+18
| | | | | | * sysdeps/generic/ldsodefs.h: Don't define _dl_name_match_p as inline. * elf/dl-misc.c: Define _dl_name_match_p here. * elf/dl-open.c (check_libc_caller): Don't use _dl_name_match_p.
* Update.Ulrich Drepper2004-03-051-7/+64
| | | | | | | 2004-03-04 Ulrich Drepper <drepper@redhat.com> * elf/dl-open.c (dl_open_worker): Check that _dl_open is called from the right place.
* Update.Ulrich Drepper2003-07-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | 2003-07-30 Jakub Jelinek <jakub@redhat.com> * elf/dl-reloc.c (_dl_allocate_static_tls): Don't return any value, call dl_signal_error directly. If already relocated, call GL(dl_init_static_tls) directly, otherwise queue it for later. (CHECK_STATIC_TLS): Undo 2003-07-24 change. * elf/rtld.c (dl_main): Initialize GL(dl_init_static_tls). * elf/dl-open.c (dl_open_worker): Call GL_dl_init_static_tls for all static TLS initializations delayed in _dl_allocate_static_tls. * elf/dl-support.c (_dl_init_static_tls): New variable. * include/link.h (struct link_map): Add l_need_tls_init. * sysdeps/generic/ldsodefs.h (_rtld_global): Add _dl_init_static_tls. (_dl_nothread_init_static_tls): New prototype. (_dl_allocate_static_tls): Adjust prototype. * elf/tls-macros.h (VAR_INT_DEF): Add alignment directive. elf_machine_rela_relative): Adjust. (CHECK_STATIC_TLS): _dl_allocate_static_tls can fail now.
* Update.Ulrich Drepper2003-01-281-1/+1
| | | | | | * elf/dl-reloc.c (CHECK_STATIC_TLS): Improve error message. * elf/dl-open.c (_dl_tls_static_size): Bump to 2048.
* 2003-01-17 Roland McGrath <roland@redhat.com>Roland McGrath2003-01-171-2/+2
| | | | * elf/dl-open.c: Fix typo ifdef -> ifndef on _dl_tls_static_size defn.
* Update.Ulrich Drepper2002-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | 2002-12-06 Ulrich Drepper <drepper@redhat.com> * misc/syslog.c (log_cleanup): New function. (openlog): Use log_cleanup instead of __libc_mutex_unlock. (closelog): Likewise. * elf/dl-close.c: Use __rtld_lock_* macros instead of __libc_lock_*. * elf/dl-iteratephdr.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-misc.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-support.c: Likewise. * elf/rtld.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/bits/libc-lock.h: Define __rtld_lock_* macros. * sysdeps/mach/bits/libc-lock.h: Likewise. * sysdeps/mach/hurd/bits/libc-lock.h: Likewise. * dirent/bug-readdir1.c (main): Don't call closedir, just close
* 2002-11-03 Roland McGrath <roland@redhat.com>Roland McGrath2002-11-051-0/+6
| | | | | | | | | | | | | | | * sysdeps/generic/ldsodefs.h (struct rtld_global): New member `_dl_tls_static_used'. * sysdeps/generic/libc-tls.c (_dl_tls_static_used): New variable. (__libc_setup_tls): Initialize it. Let the initial value of _dl_tls_static_size indicate some surplus space in the computed value. * elf/dl-open.c (_dl_tls_static_size): New variable. * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Initialize _dl_tls_static_used. Add some surplus space into _dl_tls_static_size. * elf/dl-reloc.c [USE_TLS] (allocate_static_tls): New function. (CHECK_STATIC_TLS): Use it. * elf/dl-close.c (_dl_close): Adjust _dl_tls_static_used when the closed objects occupied a trailing contiguous chunk of static TLS area.
* * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the staticRoland McGrath2002-10-221-3/+5
| | | | | | | | | | | | | | | | | | slotinfo list's len member to the proper size, not just 1. Initialize static_map.l_tls_initimage. * elf/dl-open.c (dl_open_worker): Fix loop searching for dtv_slotinfo_list element containing new modules' l_tls_modid. * elf/tst-tls9.c, elf/tst-tls9-static.c: New files. * elf/tst-tlsmod5.c, elf/tst-tlsmod6.c: New files. * elf/Makefile (tests): Add tst-tls9. (tests-static): Add tst-tls9-static. (tst-tls9-static-ENV): New variable. ($(objpfx)tst-tls9-static, $(objpfx)tst-tls9-static.out): New targets. * elf/dl-close.c (remove_slotinfo): Remove an assert; the number of modids used by partially loaded modules being closed can't be known.
* * sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL, INLINE_SYSCALL1)Roland McGrath2002-10-181-1/+1
| | | | | | | | | | (inline_syscall_clobbers, inline_syscall0, inline_syscall1) (inline_syscall2, inline_syscall3, inline_syscall4, inline_syscall5) (inline_syscall6): Move these macros ... * sysdeps/unix/sysv/linux/alpha/sysdep.h: ... to here. * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDEs for _AS_PATH_SEPARATOR_PREPARE and _AS_TEST_PREPARE.
* * sysdeps/posix/system.c (do_system): New function, guts broken out ofRoland McGrath2002-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __libc_system. (__libc_system): Call it, putting just the line == NULL test here. * include/libc-symbols.h (__hidden_proto): Add extern keywords so variables work right. * elf/dl-open.c (dl_open_worker): Use _ macro instead of gettext. * elf/dl-close.c (_dl_close): Likewise. * include/netinet/in.h: Use libc_hidden_proto for bindresvport, in6addr_any, in6addr_loopback. Remove decls for bindresvport_internal, in6addr_any_internal, in6addr_loopback_internal. * sunrpc/svc_udp.c (svcudp_bufcreate): Nix INTUSE for bindresvport. * sunrpc/svc_tcp.c (svctcp_create): Likewise. * sunrpc/clnt_udp.c (clntudp_bufcreate): Likewise. * sunrpc/bindrsvprt.c: Change INTDEF to libc_hidden_def. * inet/in6_addr.c: Change INTVARDEF to libc_hidden_def. * sysdeps/posix/getaddrinfo.c (gaih_inet): Nix INTUSE for in6addr_loopback. * inet/gethstbyad_r.c (PREPROCESS): Nix INTUSE for in6addr_any. * include/netinet/ether.h: Use libc_hidden_proto for ether_ntoa_r, ether_aton_r. * inet/ether_aton_r.c: Add libc_hidden_def. * inet/ether_ntoa_r.c: Likewise. * include/rpc/auth.h: Use libc_hidden_proto for getnetname, netname2user, host2netname. * sunrpc/netname.c: Add libc_hidden_def. * include/netdb.h: Use libc_hidden_proto for innetgr, rcmd_af, rexec_af, rresvport_af, ruserok_af. * inet/rcmd.c: Add libc_hidden_def. * inet/getnetgrent_r.c: Likewise.
* Add libc_hidden_def.Ulrich Drepper2002-08-041-0/+1
|
* Update.Ulrich Drepper2002-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stdio-common/itowa-digits.c (_itowa_lower_digits): Define as hidden. (_itowa_upper_digits): Likewise. * libio/stdio.c (_IO_stdin, _IO_stdout, _IO_stderr): Define as hidden. * libio/libio.h [_LIBC] (_IO_stdin, _IO_stdout, _IO_stderr): Declare as hidden. * libio/libioP.h: Declare _IO_file_jumps_mmap, _IO_wfile_jumps, _IO_wfile_jumps_mmap, _IO_proc_jumps, _IO_old_proc_jumps, _IO_str_jumps, _IO_wstr_jumps, _IO_file_jumps_internal, _IO_wfile_jumps_internal, and _IO_list_all_internal as hidden. * gmon/gmon.c (__bb_head): Define as hidden. * gmon/bb_exit_func.c (__bb_head): Declare as hidden. * argp/argp-parse.c (_argp_hang): Define as static. * include/libc-symbols.h (_INTVARDEF): Adjust for visibility handling in latest compilers. * inet/in6_addr.c (in6addr_any): Use INTVARDEF not INTDEF to define alias. * libio/fileops.c (_IO_file_jumps): Likewise. * libio/stdfiles.c (_IO_list_all): Likewise. * libio/wfileops.c (_IO_wfile_jumps): Likewise. * malloc/malloc.h: Move __libc_malloc_initialized declaration to include/malloc.h. * include/malloc.h: Add __libc_malloc_initialized declaration here. Mark variable hidden. * malloc/malloc.c: Include <malloc.h> not "malloc.h". * elf/dl-open.c (__libc_argc): Declare as hidden. (__libc_argv): Likewise. * sysdeps/generic/wordexp.c (__libc_argc): Declare as hidden. (__libc_argv): Likewise. * sysdeps/mach/hurd/i386/init-first.c: Define __libc_argc and __libc_argv as hidden. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. * sysdeps/unix/sysv/aix/init-first.c: Likewise. * sysdeps/unix/sysv/linux/init-first.c: Likewise.
* Update.Ulrich Drepper2002-02-161-1/+3
| | | | | | | | 2002-02-15 Ulrich Drepper <drepper@redhat.com> * elf/dl-open.c (dl_open_worker): Catch wrap-around of TLS generation counter. * elf/dl-close.c (_dl_close): Likewise.
* Update.Ulrich Drepper2002-02-131-2/+15
| | | | | * elf/dl-open.c (dl_open_worker): Only bump the generation counter if this is really necessary.
* Update.Ulrich Drepper2002-02-131-1/+2
| | | | | | 2002-02-12 Andreas Schwab <schwab@suse.de> * csu/gmon-start.c (__gmon_start__): Remove '&' from ENTRY_POINT.
* Update.Ulrich Drepper2002-02-131-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update.Ulrich Drepper2002-02-101-5/+4
| | | | | | | | | | | | | | | | | | * 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>
* Update.Ulrich Drepper2002-02-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-02-03 Andreas Schwab <schwab@suse.de> * sysdeps/posix/readv.c: Use ssize_t for bytes_read. * sysdeps/posix/writev.c: Use ssize_t for bytes_written. Fix comment. 2002-02-03 Thorsten Kukuk <kukuk@suse.de> * sysdeps/posix/writev.c: Check for ssize_t overflow, don't use alloca if the memory reqirements are too high. 2002-02-03 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (decompose_rpath): Avoid using strstr. * elf/dl-minimal.c (_strerror_r): Use _itoa instead of _itoa_word since the former is available anyway and speed isn't important here. * elf/dl-misc.c (_dl_debug_vdprintf): Likewise. * elf/dl-version.c (match_symbol): Likewise. (_dl_check_map_versions): Likewise. * elf/rtld.c (process_envvars): Likewise. (print_statistics): Likewise. * sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Likewise. * elf/dl-minimal.c (_itoa): Always define it. Make it work for all bases. Add assert to catch uses of unimplemented features. (__strsep): Add assert to catch uses of unimplemented features. * elf/dl-object.c (_dl_new_object): Don't use rawmemchr. Use strchr and avoid inline optimization. * elf/rtld.c (process_envvars): Likewise. * elf/dl-open.c: Don't include <stdio-common/_itoa.h>. * elf/dl-profile.c (_dl_start_profile): Help compiler to avoid ffs. * elf/rtld.c (dl_main): Avoid strsep inline optimization. * stdio-common/_itoa.h: Minor simplifications of the code. * stdio-common/_itoa.c: Likewise. * elf/dl-reloc.c (_dl_relocate_object): Use _dl_debug_printf instead of _dl_printf for debugging info output. * sysdeps/mips/atomicity.h (exchange_and_add): Use branch likely.