summaryrefslogtreecommitdiff
path: root/libphobos/libdruntime/core/sys/posix/dlfcn.d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-02-13 20:17:53 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-02-16 11:15:02 +0100
commitd75691877c4a7521a995d2601021fcaf30f65d94 (patch)
tree36509d835d63b98ad1130ac9d4695b5033c10428 /libphobos/libdruntime/core/sys/posix/dlfcn.d
parent023327643969d5469902a9ecfa6738a315f9e362 (diff)
d: Merge upstream dmd 52844d4b1, druntime dbd0c874, phobos 896b1d0e1.
D front-end changes: - Parsing and compiling C code is now possible using `import'. - `throw' statements can now be used as an expression. - Improvements to the D template emission strategy when compiling with `-funittest'. D Runtime changes: - New core.int128 module for implementing intrinsics to support 128-bit integer types. - C bindings for the kernel and C runtime have been better separated to allow compiling for hybrid targets, such as kFreeBSD. Phobos changes: - The std.experimental.checkedint module has been renamed to std.checkedint. gcc/d/ChangeLog: * d-builtins.cc (d_build_builtins_module): Set purity of DECL_PURE_P functions to PURE::const_. * d-gimplify.cc (bit_field_ref): New function. (d_gimplify_modify_expr): Handle implicit casting for assignments to bit-fields. (d_gimplify_unary_expr): New function. (d_gimplify_binary_expr): New function. (d_gimplify_expr): Handle UNARY_CLASS_P and BINARY_CLASS_P. * d-target.cc (Target::_init): Initialize bitFieldStyle. (TargetCPP::parameterType): Update signature. (Target::supportsLinkerDirective): New function. * dmd/MERGE: Merge upstream dmd 52844d4b1. * expr.cc (ExprVisitor::visit (ThrowExp *)): New function. * types.cc (d_build_bitfield_integer_type): New function. (insert_aggregate_bitfield): New function. (layout_aggregate_members): Handle inserting bit-fields into an aggregate type. libphobos/ChangeLog: * Makefile.in: Regenerate. * libdruntime/MERGE: Merge upstream druntime dbd0c874. * libdruntime/Makefile.am (DRUNTIME_CSOURCES): Add core/int128.d. (DRUNTIME_DISOURCES): Add __builtins.di. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos 896b1d0e1. * src/Makefile.am (PHOBOS_DSOURCES): Add std/checkedint.d. * src/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add -fall-instantiations to --gdcflags.
Diffstat (limited to 'libphobos/libdruntime/core/sys/posix/dlfcn.d')
-rw-r--r--libphobos/libdruntime/core/sys/posix/dlfcn.d80
1 files changed, 80 insertions, 0 deletions
diff --git a/libphobos/libdruntime/core/sys/posix/dlfcn.d b/libphobos/libdruntime/core/sys/posix/dlfcn.d
index f6476ec3106..a9519ca234a 100644
--- a/libphobos/libdruntime/core/sys/posix/dlfcn.d
+++ b/libphobos/libdruntime/core/sys/posix/dlfcn.d
@@ -66,59 +66,100 @@ version (CRuntime_Glibc)
{
version (X86_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0x00000;
+ enum RTLD_NODELETE = 0x01000;
}
else version (HPPA_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/hppa/bits/dlfcn.h
enum RTLD_LAZY = 0x0001;
enum RTLD_NOW = 0x0002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x0100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else version (MIPS_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/mips/bits/dlfcn.h
enum RTLD_LAZY = 0x0001;
enum RTLD_NOW = 0x0002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00008;
+ enum RTLD_DEEPBIND = 0x00010;
enum RTLD_GLOBAL = 0x0004;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else version (PPC_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else version (ARM_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else version (RISCV_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else version (SPARC_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
+
}
else version (IBMZ_Any)
{
+ // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_BINDING_MASK = 0x3;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
+ enum RTLD_NODELETE = 0x01000;
}
else
static assert(0, "unimplemented");
@@ -127,13 +168,25 @@ version (CRuntime_Glibc)
char* dlerror();
void* dlopen(const scope char*, int);
void* dlsym(void*, const scope char*);
+ int dladdr(const scope void*, Dl_info*);
+
+ struct Dl_info
+ {
+ const(char)* dli_fname;
+ void* dli_fbase;
+ const(char)* dli_sname;
+ void* dli_saddr;
+ }
}
else version (Darwin)
{
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
+ enum RTLD_NOLOAD = 0x10;
+ enum RTLD_NODELETE = 0x80;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0x00000;
+ enum RTLD_FIRST = 0x100;
int dlclose(void*);
char* dlerror();
@@ -153,8 +206,12 @@ else version (FreeBSD)
{
enum RTLD_LAZY = 1;
enum RTLD_NOW = 2;
+ enum RTLD_MODEMASK = 0x3;
enum RTLD_GLOBAL = 0x100;
enum RTLD_LOCAL = 0;
+ enum RTLD_TRACE = 0x200;
+ enum RTLD_NODELETE = 0x01000;
+ enum RTLD_NOLOAD = 0x02000;
int dlclose(void*);
char* dlerror();
@@ -199,6 +256,8 @@ else version (OpenBSD)
enum RTLD_NOW = 2;
enum RTLD_GLOBAL = 0x100;
enum RTLD_LOCAL = 0;
+ enum RTLD_TRACE = 0x200;
+ enum RTLD_NODELETE = 0x400;
int dlclose(void*);
char* dlerror();
@@ -218,8 +277,12 @@ else version (DragonFlyBSD)
{
enum RTLD_LAZY = 1;
enum RTLD_NOW = 2;
+ enum RTLD_MODEMASK = 0x3;
enum RTLD_GLOBAL = 0x100;
enum RTLD_LOCAL = 0;
+ enum RTLD_TRACE = 0x200;
+ enum RTLD_NODELETE = 0x01000;
+ enum RTLD_NOLOAD = 0x02000;
int dlclose(void*);
char* dlerror();
@@ -239,8 +302,16 @@ else version (Solaris)
{
enum RTLD_LAZY = 1;
enum RTLD_NOW = 2;
+ enum RTLD_NOLOAD = 0x00004;
+ enum RTLD_DEEPBIND = 0x00008;
enum RTLD_GLOBAL = 0x100;
enum RTLD_LOCAL = 0;
+ enum RTLD_PARENT = 0x00200;
+ enum RTLD_GROUP = 0x00400;
+ enum RTLD_WORLD = 0x00800;
+ enum RTLD_NODELETE = 0x01000;
+ enum RTLD_FIRST = 0x02000;
+ enum RTLD_CONFGEN = 0x10000;
int dlclose(void*);
char* dlerror();
@@ -343,4 +414,13 @@ else version (CRuntime_UClibc)
char* dlerror();
void* dlopen(const scope char*, int);
void* dlsym(void*, const scope char*);
+ int dladdr(const scope void*, Dl_info*);
+
+ struct Dl_info
+ {
+ const(char)* dli_fname;
+ void* dli_fbase;
+ const(char)* dli_sname;
+ void* dli_saddr;
+ }
}