about summary refs log tree commit diff
path: root/dlfcn/dlerror.c
Commit message (Collapse)AuthorAgeFilesLines
* dlfcn: Do not use rtld_active () to determine ld.so state (bug 29078)Florian Weimer2022-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | When audit modules are loaded, ld.so initialization is not yet complete, and rtld_active () returns false even though ld.so is mostly working. Instead, the static dlopen hook is used, but that does not work at all because this is not a static dlopen situation. Commit 466c1ea15f461edb8e3ffaf5d86d708876343bbf ("dlfcn: Rework static dlopen hooks") moved the hook pointer into _rtld_global_ro, which means that separate protection is not needed anymore and the hook pointer can be checked directly. The guard for disabling libio vtable hardening in _IO_vtable_check should stay for now. Fixes commit 8e1472d2c1e25e6eabc2059170731365f6d5b3d1 ("ld.so: Examine GLRO to detect inactive loader [BZ #20204]"). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* elf: Clean up GLIBC_PRIVATE exports of internal libdl symbolsFlorian Weimer2021-07-071-1/+0
| | | | | | | | They are no longer needed after everything has been moved into libc. The _dl_vsym test has to be removed because the symbol cannot be used outside libc anymore. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* dlfcn: Rework static dlopen hooksFlorian Weimer2021-06-031-31/+1
| | | | | | | | | | | | | | Consolidate all hooks structures into a single one. There are no static dlopen ABI concerns because glibc 2.34 already comes with substantial ABI-incompatible changes in this area. (Static dlopen requires the exact same dynamic glibc version that was used for static linking.) The new approach uses a pointer to the hooks structure into _rtld_global_ro and initalizes it in __rtld_static_init. This avoids a back-and-forth with various callback functions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* dlfcn: Move dlerror into libcFlorian Weimer2021-06-021-24/+19
| | | | | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. There is a minor functionality enhancement: dlerror now sets errno if it was set as part of the exception. (This is the result of using %m in asprintf, to avoid the strerror PLT call.) The previous errno value upon function return was unpredictable. Documenting this as a feature is premature; we need to make sure that the error codes are meaningful when they are set by the dynamic loader. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* dlfcn: dlerror needs to call free from the base namespace [BZ #24773]Florian Weimer2021-04-211-178/+127
| | | | | | | | | | | | Calling free directly may end up freeing a pointer allocated by the dynamic loader using malloc from libc.so in the base namespace using the allocator from libc.so in a secondary namespace, which results in crashes. This commit redirects the free call through GLRO and the dynamic linker, to reach the correct namespace. It also cleans up the dlerror handling along the way, so that pthread_setspecific is no longer needed (which avoids triggering bug 24774).
* dlfcn: Failures after dlmopen should not terminate process [BZ #24772]Florian Weimer2021-04-211-2/+4
| | | | | | | | | | | | | | | | | | | Commit 9e78f6f6e7134a5f299cc8de77370218f8019237 ("Implement _dl_catch_error, _dl_signal_error in libc.so [BZ #16628]") has the side effect that distinct namespaces, as created by dlmopen, now have separate implementations of the rtld exception mechanism. This means that the call to _dl_catch_error from libdl in a secondary namespace does not actually install an exception handler because the thread-local variable catch_hook in the libc.so copy in the secondary namespace is distinct from that of the base namepace. As a result, a dlsym/dlopen/... failure in a secondary namespace terminates the process with a dynamic linker error because it looks to the exception handler mechanism as if no handler has been installed. This commit restores GLRO (dl_catch_error) and uses it to set the handler in the base namespace. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* dlfcn: Guard __dlerror_main_freeres with __libc_once_get (once) [BZ# 24476]Mark Wielaard2019-05-151-8/+21
| | | | | | | | | | | | | | | | | | dlerror.c (__dlerror_main_freeres) will try to free resources which only have been initialized when init () has been called. That function is called when resources are needed using __libc_once (once, init) where once is a __libc_once_define (static, once) in the dlerror.c file. Trying to free those resources if init () hasn't been called will produce errors under valgrind memcheck. So guard the freeing of those resources using __libc_once_get (once) and make sure we have a valid key. Also add a similar guard to __dlerror (). * dlfcn/dlerror.c (__dlerror_main_freeres): Guard using __libc_once_get (once) and static_bug == NULL. (__dlerror): Check we have a valid key, set result to static_buf otherwise. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* malloc: tcache double free checkDJ Delorie2018-11-201-1/+4
| | | | | | | | | | | | | * malloc/malloc.c (tcache_entry): Add key field. (tcache_put): Set it. (tcache_get): Likewise. (_int_free): Check for double free in tcache. * malloc/tst-tcfree1.c: New. * malloc/tst-tcfree2.c: New. * malloc/Makefile: Run the new tests. * manual/probes.texi: Document memory_tcache_double_free probe. * dlfcn/dlerror.c (check_free): Prevent double frees.
* libc: Extend __libc_freeres framework (Bug 23329).Carlos O'Donell2018-06-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | The __libc_freeres framework does not extend to non-libc.so objects. This causes problems in general for valgrind and mtrace detecting unfreed objects in both libdl.so and libpthread.so. This change is a pre-requisite to properly moving the malloc hooks out of malloc since such a move now requires precise accounting of all allocated data before destructors are run. This commit adds a proper hook in libc.so.6 for both libdl.so and for libpthread.so, this ensures that shm-directory.c which uses freeit () to free memory is called properly. We also remove the nptl_freeres hook and fall back to using weak-ref-and-check idiom for a loaded libpthread.so, thus making this process similar for all DSOs. Lastly we follow best practice and use explicit free calls for both libdl.so and libpthread.so instead of the generic hook process which has undefined order. Tested on x86_64 with no regressions. Signed-off-by: DJ Delorie <dj@redhat.com> Signed-off-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* ld.so: Examine GLRO to detect inactive loader [BZ #20204]Florian Weimer2017-12-181-1/+1
| | | | | | | | | | | | GLRO (_rtld_global_ro) is read-only after initialization and can therefore not be patched at run time, unlike the hook table addresses and their contents, so this is a desirable hardening feature. The hooks are only needed if ld.so has not been initialized, and this happens only after static dlopen (dlmopen uses a single ld.so object across all namespaces). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* dlfcn: Remove internal_function attributeFlorian Weimer2017-08-311-1/+0
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Implement _dl_catch_error, _dl_signal_error in libc.so [BZ #16628]Florian Weimer2016-11-301-2/+2
| | | | | | | | | | | | | | | | | | This change moves the main implementation of _dl_catch_error, _dl_signal_error to libc.so, where TLS variables can be used directly. This removes a writable function pointer from the rtld_global variable. For use during initial relocation, minimal implementations of these functions are provided in ld.so. These are eventually interposed by the libc.so implementations. This is implemented by compiling elf/dl-error-skeleton.c twice, via elf/dl-error.c and elf/dl-error-minimal.c. As a side effect of this change, the static version of dl-error.c no longer includes support for the _dl_signal_cerror/_dl_receive_error mechanism because it is only used in ld.so.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912).Joseph Myers2015-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was noted in <https://sourceware.org/ml/libc-alpha/2012-09/msg00305.html> that the bits/*.h naming scheme should only be used for installed headers. This patch renames bits/libc-lock.h to plain libc-lock.h and bits/libc-lockP.h to plain libc-lockP.h to follow that convention. Note that I don't know where libc-lockP.h comes from for Hurd (the Hurd libc-lock.h includes libc-lockP.h, but the only libc-lockP.h in the glibc source tree is for NPTL) - some unmerged patch? - but I updated the #include in the Hurd libc-lock.h anyway. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #14912] * bits/libc-lock.h: Move to ... * sysdeps/generic/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/mach/hurd/bits/libc-lock.h: Move to ... * sysdeps/mach/hurd/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. [_LIBC]: Include <libc-lockP.h> instead of <bits/libc-lockP.h>. * sysdeps/mach/bits/libc-lock.h: Move to ... * sysdeps/mach/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lock.h: Move to ... * sysdeps/nptl/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lockP.h: Move to ... * sysdeps/nptl/libc-lockP.h: ...here. (_BITS_LIBC_LOCKP_H): Rename macro to _LIBC_LOCKP_H. * crypt/crypt_util.c: Include <libc-lock.h> instead of <bits/libc-lock.h>. * dirent/scandir-tail.c: Likewise. * dlfcn/dlerror.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-iteratephdr.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-writev.h: Likewise. * elf/rtld.c: Likewise. * grp/fgetgrent.c: Likewise. * gshadow/fgetsgent.c: Likewise. * gshadow/sgetsgent.c: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/gconv_db.c: Likewise. * iconv/gconv_dl.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_trans.c: Likewise. * include/link.h: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent.c: Likewise. * inet/getnetgrent_r.c: Likewise. * intl/bindtextdom.c: Likewise. * intl/dcigettext.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettextP.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/textdomain.c: Likewise. * libidn/idn-stub.c: Likewise. * libio/libioP.h: Likewise. * locale/duplocale.c: Likewise. * locale/freelocale.c: Likewise. * locale/newlocale.c: Likewise. * locale/setlocale.c: Likewise. * login/getutent_r.c: Likewise. * login/getutid_r.c: Likewise. * login/getutline_r.c: Likewise. * login/utmp-private.h: Likewise. * login/utmpname.c: Likewise. * malloc/mtrace.c: Likewise. * misc/efgcvt.c: Likewise. * misc/error.c: Likewise. * misc/fstab.c: Likewise. * misc/getpass.c: Likewise. * misc/mntent.c: Likewise. * misc/syslog.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nss-default.c: Likewise. * nis/nss_compat/compat-grp.c: Likewise. * nis/nss_compat/compat-initgroups.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/nss_nisplus/nisplus-alias.c: Likewise. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-initgroups.c: Likewise. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. * nis/ypclnt.c: Likewise. * nptl/libc_pthread_init.c: Likewise. * nss/getXXbyYY.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_db/db-XXX.c: Likewise. * nss/nss_db/db-netgrp.c: Likewise. * nss/nss_db/nss_db.h: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-alias.c: Likewise. * nss/nsswitch.c: Likewise. * posix/regex_internal.h: Likewise. * posix/wordexp.c: Likewise. * pwd/fgetpwent.c: Likewise. * resolv/res_hconf.c: Likewise. * resolv/res_libc.c: Likewise. * shadow/fgetspent.c: Likewise. * shadow/lckpwdf.c: Likewise. * shadow/sgetspent.c: Likewise. * socket/opensock.c: Likewise. * stdio-common/reg-modifier.c: Likewise. * stdio-common/reg-printf.c: Likewise. * stdio-common/reg-type.c: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/abort.c: Likewise. * stdlib/cxa_atexit.c: Likewise. * stdlib/fmtmsg.c: Likewise. * stdlib/random.c: Likewise. * stdlib/setenv.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_none.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/create_xid.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/rpc_thread.c: Likewise. * sysdeps/arm/backtrace.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/stdio-lock.h: Likewise. * sysdeps/generic/unwind-dw2-fde.c: Likewise. * sysdeps/i386/backtrace.c: Likewise. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Likewise. * sysdeps/m68k/backtrace.c: Likewise. * sysdeps/mach/hurd/cthreads.c: Likewise. * sysdeps/mach/hurd/dirstream.h: Likewise. * sysdeps/mach/hurd/malloc-machine.h: Likewise. * sysdeps/nptl/malloc-machine.h: Likewise. * sysdeps/nptl/stdio-lock.h: Likewise. * sysdeps/posix/dirstream.h: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. * sysdeps/posix/system.c: Likewise. * sysdeps/pthread/aio_suspend.c: Likewise. * sysdeps/s390/s390-32/backtrace.c: Likewise. * sysdeps/s390/s390-64/backtrace.c: Likewise. * sysdeps/unix/sysv/linux/check_pf.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c: Likewise. * sysdeps/unix/sysv/linux/shm-directory.c: Likewise. * sysdeps/unix/sysv/linux/system.c: Likewise. * sysdeps/x86_64/backtrace.c: Likewise. * time/alt_digit.c: Likewise. * time/era.c: Likewise. * time/tzset.c: Likewise. * wcsmbs/wcsmbsload.c: Likewise. * nptl/tst-initializers1.c (do_test): Refer to <libc-lock.h> instead of <bits/libc-lock.h> in comment.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Remove IS_IN_libdlSiddhesh Poyarekar2014-11-241-1/+1
| | | | | | | | | | | | | | Replace with IS_IN (libdl). No changes to generated code on x86_64. * dlfcn/dladdr.c: Use IS_IN. * dlfcn/dladdr1.c: Likewise. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlinfo.c: Likewise. * dlfcn/dlmopen.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlsym.c: Likewise. * dlfcn/dlvsym.c: Likewise.
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Free errstring if _dl_addr doesn't returns 0Roland McGrath2012-10-091-4/+7
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* * elf/dl-error.c (_dl_signal_error): Store information about use ofUlrich Drepper2005-06-121-2/+4
| | | | | | | | | | | | | | | | | 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.
* * dlfcn/dlerror.c (check_free): New function. Extract common codeUlrich Drepper2005-02-261-9/+22
| | | | | from fini and free_key_mem. Check whether this is libdl in the base namespace.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-26/+11
|
* 2.5-18.1Jakub Jelinek2007-07-121-11/+26
|
* Update. cvs/fedora-glibc-20041018T2320Ulrich Drepper2004-10-181-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-10-18 Jakub Jelinek <jakub@redhat.com> * elf/dl-libc.c (__libc_dlsym_private, __libc_register_dl_open_hook): New functions. (__libc_dlopen_mode): Call __libc_register_dl_open_hook and __libc_register_dlfcn_hook. * dlfcn/Makefile (routines, elide-routines.os): Set. Add rules to build and test tststatic2. * dlfcn/tststatic2.c: New test. * dlfcn/modstatic2.c: New test module. * dlfcn/dladdr.c: Call _dlfcn_hook from libdl.so if not NULL. Define __ prefixed routine in libc.a and in libdl.a just call it. * dlfcn/dladdr1.c: Likewise. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlinfo.c: Likewise. * dlfcn/dlmopen.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * dlfcn/dlsym.c: Likewise. * dlfcn/dlvsym.c: Likewise. * dlfcn/sdladdr.c: New file. * dlfcn/sdladdr1.c: New file. * dlfcn/sdlclose.c: New file. * dlfcn/sdlerror.c: New file. * dlfcn/sdlinfo.c: New file. * dlfcn/sdlopen.c: New file. * dlfcn/sdlsym.c: New file. * dlfcn/sdlvsym.c: New file. * dlfcn/Versions (libdl): Export _dlfcn_hook@GLIBC_PRIVATE. * include/dlfcn.h (DL_CALLER_DECL, DL_CALLER RETURN_ADDRESS): Define. (struct dlfcn_hook): New type. (_dlfcn_hook): New extern decl. (__dlopen, __dlclose, __dlsym, __dlerror, __dladdr, __dladdr1, __dlinfo, __dlmopen, __libc_dlsym_private, __libc_register_dl_open_hook, __libc_register_dlfcn_hook): New prototypes. (__dlvsym): Use DL_CALLER_DECL. * include/libc-symbols.h: Define libdl_hidden_proto and friends. * malloc/arena.c (_dl_open_hook): Extern decl. (ptmalloc_init): Don't call _dl_addr when dlopened from statically linked programs but don't use brk for them either.
* Update.Ulrich Drepper2004-03-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 Drepper2003-07-311-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-07-31 Jakub Jelinek <jakub@redhat.com> * dlfcn/dlerror.c (once): New. (dlerror): Call __libc_once. (_dlerror_run): Remove once. 2003-07-31 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h (struct sigcontext): Sync with 2.5.7 and 2.5.73 kernel changes. 2003-07-31 Jakub Jelinek <jakub@redhat.com> * dlfcn/eval.c (funcall): Add noinline attribute to shut up warnings. * elf/rtld.c (dl_main): Cast ElfW(Addr) arguments with %Zx/%Zd formats to size_t. * elf/dl-lookup.c (_dl_debug_bindings): Likewise. * elf/tst-tls6.c (do_test): Use %zd format for l_tls_modid. * elf/tst-tls8.c (do_test): Use %zd format for modid1 and modid2. * gmon/tst-sprofil.c (main): Add parens to shut up warning. * iconv/tst-iconv3.c (main): Use %td instead of %zd for pointer difference argument. * stdio-common/tst-wc-printf.c (main): Cast arguments with %C format to wint_t. * stdlib/tst-limits.c (main): For WORD_BIT and LONG_BIT, use %d format and cast expected value to int. * sysdeps/generic/libc-start.c (STATIC): Add __attribute__((always_inline) if LIBC_START_MAIN is already defined. * sysdeps/powerpc/fpu/w_sqrt.c (a_nan, a_inf): Change from uint32_t to ieee_float_shape_type. (__sqrt): Avoid type punning. * sysdeps/powerpc/fpu/w_sqrtf.c (a_nan, a_inf): Change from uint32_t to ieee_float_shape_type. (__sqrtf): Avoid type punning. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Don't define refsym if in dl-conflict.c. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/i386/semctl.c (union semun): Add __old_buf. (__new_semctl): Shut up warning. * sysdeps/unix/sysv/linux/semctl.c (union semun): Add __old_buf. (__new_semctl): Shut up warning. * sysdeps/unix/sysv/linux/shmctl.c (__new_shmctl): Wrap long lines. Change old into union of __old_shmid_ds and __old_shminfo structs. Adjust all users. * wcsmbs/wcsmbs-tst1.c (main): Cast arguments with %C format to wint_t. 2003-07-31 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/utimes.c (__utimes): Fix actime and modtime computation. * sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise. * sysdeps/posix/utimes.c (__utimes): Likewise.
* 2003-03-14 Roland McGrath <roland@redhat.com>Roland McGrath2003-03-151-4/+14
| | | | * dlfcn/dlerror.c (dlerror): If objname is "", don't put ": " after it.
* * sysdeps/hppa/fpu/libm-test-ulps: New file (generated).Roland McGrath2002-11-191-1/+11
| | | | | | | | | | | | | | | | | | | | | | | * sysdeps/hppa/Makefile (CFLAGS-rtld.c): New variable. Set -mdisable-fpregs for this file. 2002-11-11 Carlos O'Donell <carlos@baldric.uwo.ca> * sysdeps/unix/sysv/linux/configure.in: Make 2.4.19 minimum linux kernel for hppa, and add unwind symbols from gcc-3.0 era for backwards compatibility. * sysdeps/unix/sysv/linux/configure: Regenerate. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Define mcontext_t as a sigcontext. * dlfcn/dlerror.c (fini): New function, __attribute__ ((destructor)). Free memory in `last_result' if it was used. * resolv/nss_dns/dns-network.c (getanswer_r): In BYNAME case, search all aliases for one that matches the "<dotted-quad>.IN-ADDR.ARPA" form. Do the parsing inline instead of copying strings and calling inet_network, and properly skip all alias names not matching the form.
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-8/+8
| | | | | | | | | | | | | | 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.
* Update.Ulrich Drepper2001-01-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * manual/Makefile (TEXI2PDF): Change to texi2dvi --pdf. Suggested by Minko Markov <mmarkov@home.com>. 2001-01-02 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> * sysdeps/powerpc/elf/start.S (__data_start): Make it global. * sysdeps/powerpc/dl-machine.c (dl_reloc_overflow): Print the name of the failing symbol. (__process_machine_rela): Pass symbol to dl_reloc_overflow(). 2001-01-02 Ben Collins <bcollins@debian.org> * time/tzset.c (tzset_internal): Make sure we fall back to UTC if TZ is not set and TZDEFAULT is not present. 2001-01-01 Ben Collins <bcollins@debian.org> * string/strings.h: Make sure we declare our functions even if string.h is already included, based on whether or not __USE_BSD is defined. 2001-01-02 Ulrich Drepper <drepper@redhat.com> * dlfcn/dlerror.c (dlerror): Handle call of dlerror() before any other dlopen() and dlsym(). Based on a patch by Ben Collins <bcollins@debian.org>. 2001-01-02 Andreas Jaeger <aj@suse.de> * dlfcn/errmsg1.c (main): Call dlerror initially. Reported by Ben Collins <bcollins@debian.org>. 2001-01-02 Ulrich Drepper <drepper@redhat.com>
* Update.Ulrich Drepper2000-12-281-4/+3
| | | | | * dlfcn/dlerror.c (dlerror): Always create output string which includes object file name.
* Update.Ulrich Drepper2000-07-141-1/+1
| | | | | | * dlfcn/dlerror.c (free_key_mem): Add cast to silence compiler warning. 2000-07-14 Mark Kettenis <kettenis@gnu.org>
* Update.Ulrich Drepper2000-07-131-4/+12
| | | | | | | | | | | | | | | | | | * elf/Versions (ld): Export _dl_out_of_memory for GLIBC_2.2. * dlfcn/dlerror.c (dlerror): Don't free the error string if it is the report that we are out of memory. * elf/dl-deps.c (_dl_map_object_deps): Likewise. * elf/dl-libc.c (dlerror_run): Likewise. * elf/dl-open.c (_dl_open): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-error.c: Define _dl_out_of_memory. (_dl_signal_error): Return _dl_signal_error if we cannot duplicate the error string. * sysdeps/generic/ldsodefs.h: Declare _dl_out_of_memory. * dlfcn/dlerror.c (free_key_mem): Also free error string. * iconv/loop.c: Fix comment.
* Update.Ulrich Drepper2000-06-101-3/+6
| | | | | | | | | | | | | 2000-06-09 H.J. Lu <hjl@gnu.org> * dlfcn/dlerror.c (_dlerror_run): Set result->errstring to NULL after freeing it. * dlfcn/Makefile (distribute): Add failtestmod.c. (tests): Add failtest. Add rules to build and run failtest. * dlfcn/failtest.c: New file. * dlfcn/failtestmod.c: New file.
* Update.Ulrich Drepper2000-06-101-9/+13
| | | | | | * dlfcn/dlerror.c (struct dl_action_result): Add objname member. (dlerror): Add objname to asprintf() parameters. (_dl_error_run): Pass new parameter to _dl_catch_error.
* Update.Ulrich Drepper1999-08-011-21/+28
| | | | | | | | | | | | 1999-08-01 Ulrich Drepper <drepper@cygnus.com> * elf/dl-sym.c (_dl_sym): Always determine module of the caller to pass it to _dl_lookup_symbol. * elf/dl-error.c (_dl_signal_error): Optimize string generation a bit. Reword message. * dlfcn/dlerror.c: Make code thread-safe.
* Update.Ulrich Drepper1999-07-071-0/+144
* sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>