Home | History | Annotate | Download | only in include
History log of /src/include/dlfcn.h
RevisionDateAuthorComments
 1.26  02-Nov-2024  nia Expose dladdr(3) to POSIX.1.2024 applications.
 1.25  11-Jul-2017  joerg branches: 1.25.18;
Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
 1.24  16-Feb-2012  joerg branches: 1.24.24;
Add _dlauxinfo helper function to provide access to the ELF auxilary
vector. This can normally be found via __ps_strings, but libc is
initialised too early when linked dynamically and doesn't have access to
it yet, so provide an alternative mechanism via ld.elf_so.
Bump libc minor.
 1.23  25-Jun-2011  nonaka branches: 1.23.2;
PR/45015: ld.elf_so: support ELF symbol versioning
Applied latest patch.
 1.22  24-Dec-2010  skrll Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
 1.21  07-Jan-2010  skrll Typo in comment.
 1.20  24-Sep-2009  pooka Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object. Other Solaris queries are currently
unimplemented.
 1.19  28-Apr-2008  martin branches: 1.19.8; 1.19.10; 1.19.16;
Remove clause 3 and 4 from TNF licenses
 1.18  21-Mar-2005  kleink branches: 1.18.18;
Add restrict qualifiers to dlsym() (XSI) and dladdr() arguments.
 1.17  03-Feb-2005  perry branches: 1.17.2;
de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
 1.16  01-Jul-2003  skrll Remove reference to dlinfo - it doesn't exist in NetBSD.
 1.15  30-May-2003  christos Add RTLD_SELF, RTLD_NEXT, RTLD_DEFAULT, from FreeBSD
 1.14  28-Apr-2003  bjh21 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.13  13-Jun-2000  simonb branches: 1.13.6;
Remove 'extern' from function declarations.
 1.12  11-Feb-2000  thorpej branches: 1.12.2;
Const'ify dli_saddr in struct _dl_info.
 1.11  08-Feb-2000  scottb change first argument of dladdr to const.
 1.10  19-May-1999  kleink Declare dlerror()'s return value __aconst.
 1.9  05-Sep-1998  pk Assign my copyright to the TNF.
 1.8  14-Jul-1998  tv Change ld.so default behavior to RTLD_LOCAL, and make RTLD_LOCAL into a
new flag bit. Keep RTLD_GLOBAL as an actual flag bit so it won't be
re-used, or may be used for something later. Mask the dlopen() mode bits
in ld.elf_so so a comparison against RTLD_NOW works. (RTLD_{LOCAL,GLOBAL}
needs to be implemented for ld.elf_so.)
 1.7  12-May-1998  pk Add dladdr() and `Dl_info' structure; interface cloned from Solaris 2.
 1.6  06-May-1998  kleink Per XSH98, define the RTLD_LOCAL flag. In this implementation it's a NOP,
since non-local searches have to be explicitly enabled via RTLD_GLOBAL.
 1.5  25-Mar-1998  kleink Protect the dlctl() prototype and the DL_* macros against _XOPEN_SOURCE;
they are neither specified by the XPG nor part of the name space reserved for
implementation-defined use.
 1.4  15-Mar-1998  pk Define RTLD_GLOBAL.
 1.3  02-Jan-1997  pk Add `const' to dlopen() & dlsym() protos, per PR#2453.
Add RTLD_NOW.
 1.2  05-Jun-1995  pk {BEGIN,END}DECLS
 1.1  05-Jun-1995  pk Put dlopen() et.al. declarations in separate header file for compatibility.
 1.12.2.1  23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.6.2  28-May-2004  tron Pull up revision 1.16 (requested by skrll in ticket #1702):
Remove reference to dlinfo - it doesn't exist in NetBSD.
 1.13.6.1  28-May-2004  tron Pull up revision 1.15 (requested by skrll in ticket #1702):
Add RTLD_SELF, RTLD_NEXT, RTLD_DEFAULT, from FreeBSD
 1.17.2.1  21-Mar-2005  jwise Pull up revision 1.18 of include/dlfcn.h (requested by kleink in [pullup-3 #39])
Pull up revision 1.19 of share/man/man3/dlfcn.3) (requested by kleink in same)

Add restrict qualifiers to dlsym() (XSI) and dladdr() arguments.
 1.18.18.1  18-May-2008  yamt sync with head.
 1.19.16.1  21-Apr-2010  matt sync to netbsd-5
 1.19.10.2  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.19.10.1  28-Apr-2008  martin file dlfcn.h was added on branch christos-time_t on 2008-04-28 20:22:55 +0000
 1.19.8.1  14-Oct-2009  sborrill Pull up the following revisions(s) (requested by pooka in ticket #1088):
include/dlfcn.h: revision 1.20
lib/libc/dlfcn/dlfcn_elf.c: revision 1.6
libexec/ld.elf_so/reloc.c: revision 1.97
libexec/ld.elf_so/rtld.c: revision 1.125
libexec/ld.elf_so/rtld.h: revision 1.81
libexec/ld.elf_so/symbol.c: revision 1.48

Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object. Other Solaris queries are currently
unimplemented.
 1.23.2.1  17-Apr-2012  yamt sync with head
 1.24.24.1  29-Aug-2017  bouyer Pull up following revision(s) (requested by joerg in ticket #127):
tests/libexec/ld.elf_so/h_thread_local_dtor.c: revision 1.1
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/c++config.h: revision 1.17
lib/libc/stdlib/atexit.h: file removal
lib/libc/stdlib/exit.c: revision 1.16
external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h: revision 1.8
lib/libc/stdlib/exit.c: revision 1.17
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hf/c++config.h: revision 1.14
distrib/sets/lists/debug/shl.mi: revision 1.178
external/gpl3/gcc/lib/libstdc++-v3/arch/sh3el/c++config.h: revision 1.21
distrib/sets/lists/debug/shl.mi: revision 1.179
distrib/sets/lists/debug/mi: revision 1.219
lib/libpthread/pthread.c: revision 1.150
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7/c++config.h: revision 1.14
libexec/ld.elf_so/symbols.map: revision 1.2
include/dlfcn.h: revision 1.25
external/gpl3/gcc/lib/libstdc++-v3/arch/arm/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/x86_64/c++config.h: revision 1.23
external/gpl3/gcc/lib/libstdc++-v3/arch/mips64el/c++config.h: revision 1.18
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4eb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/mipsel/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/ia64/c++config.h: revision 1.5
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6eb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmhf/c++config.h: revision 1.17
distrib/sets/lists/tests/mi: revision 1.755
external/gpl3/gcc/lib/libstdc++-v3/arch/mips64eb/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/i386/c++config.h: revision 1.20
external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/armeb/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/sparc/c++config.h: revision 1.20
lib/libc/dlfcn/dlfcn_elf.c: revision 1.14
tests/libexec/ld.elf_so/t_thread_local_dtor.sh: revision 1.1
tests/lib/libpthread/t_thread_local_dtor.sh: revision 1.1
lib/libc/stdlib/Makefile.inc: revision 1.93
lib/libc/include/atexit.h: revision 1.1
lib/libc/include/atexit.h: revision 1.2
external/gpl3/gcc/lib/libstdc++-v3/arch/m68k/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hf/c++config.h: revision 1.14
distrib/sets/lists/debug/shl.mi: revision 1.180
external/gpl3/gcc/lib/libstdc++-v3/arch/sparc64/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hfeb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hfeb/c++config.h: revision 1.14
lib/libc/stdlib/cxa_thread_atexit.c: revision 1.1
tests/libexec/ld.elf_so/helper_dso3/h_helper_dso3.cpp: revision 1.1
tests/libexec/ld.elf_so/helper_dso3/Makefile: revision 1.1
external/gpl3/gcc/lib/libstdc++-v3/arch/riscv64/c++config.h: revision 1.5
libexec/ld.elf_so/rtld.c: revision 1.185
external/gpl3/gcc/lib/libstdc++-v3/arch/sh3eb/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h: revision 1.5
external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/c++config.h: revision 1.15
external/gpl3/gcc/lib/libstdc++-v3/arch/mipseb/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/coldfire/c++config.h: revision 1.12
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmhfeb/c++config.h: revision 1.15
external/gpl3/gcc/lib/libstdc++-v3/arch/alpha/c++config.h: revision 1.19
tests/libexec/ld.elf_so/Makefile: revision 1.9
external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc/c++config.h: revision 1.20
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7eb/c++config.h: revision 1.14
tests/lib/libpthread/h_thread_local_dtor.cpp: revision 1.1
distrib/sets/lists/tests/shl.mi: revision 1.11
tests/lib/libpthread/Makefile: revision 1.13
libexec/ld.elf_so/rtld.h: revision 1.129
external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h: revision 1.6
Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.
If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.
Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
Fix filename of new debug file
Add misising DEBUGLIB file
Avoid common declaration.
Drop TLS variant checks, emutls is enough for VAX and Sun2.
 1.25.18.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed