[RFC,v3,1/6] Declare and describe the dlmopen RTLD_SHARED flag
Commit Message
On 08/20/2018 09:54 AM, Vivek Das Mohapatra wrote:
> This flag will instruct dlmopen to create a shared object present
> in the main namespace and accessible from the selected namespace
> when supplied in the MODE argument.
Thank you for continuing to pursue these patches.
I appreciate that you are willing to work with us to refine these patches
into something we can support for our users.
Again, I think dlmopen is very useful.
> ---
> bits/dlfcn.h | 7 +++++++
> sysdeps/mips/bits/dlfcn.h | 7 +++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/bits/dlfcn.h b/bits/dlfcn.h
> index b0b129b66b..52ce898343 100644
> --- a/bits/dlfcn.h
> +++ b/bits/dlfcn.h
> @@ -32,6 +32,13 @@
> visible as if the object were linked directly into the program. */
> #define RTLD_GLOBAL 0x00100
>
> +/* If the following bit is set in the MODE argument to dlmopen
> + then the target object is loaded into the main namespace (if
> + it is not already there) and a shallow copy (proxy) is placed
> + in the target namespace: This allows multiple namespaces to
> + share a single instance of a DSO. */
> +#define RTLD_SHARED 0x00080
OK.
> +
> /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
> The implementation does this by default and so we can define the
> value to zero. */
> diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h
> index 471ab4fdda..32744ef196 100644
> --- a/sysdeps/mips/bits/dlfcn.h
> +++ b/sysdeps/mips/bits/dlfcn.h
> @@ -32,6 +32,13 @@
> visible as if the object were linked directly into the program. */
> #define RTLD_GLOBAL 0x0004
>
> +/* If the following bit is set in the MODE argument to dlmopen
> + then the target object is loaded into the main namespace (if
> + it is not already there) and a shallow copy (proxy) is placed
> + in the target namespace: This allows multiple namespaces to
> + share a single instance of a DSO. */
> +#define RTLD_SHARED 0x00020
Please make the constants match across all arches if there are bits.
I would even go as far as doing this:
---
That way we try to synchronize the implementations rather than letting
the constants diverge.
> +
> /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
> The implementation does this by default and so we can define the
> value to zero. */
>
@@ -24,13 +24,15 @@
#define RTLD_LAZY 0x0001 /* Lazy function call binding. */
#define RTLD_NOW 0x0002 /* Immediate function call binding. */
#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
+/* 0x00004 Avoid. Generic RTLD_NOLOAD. */
#define RTLD_NOLOAD 0x00008 /* Do not load the object. */
#define RTLD_DEEPBIND 0x00010 /* Use deep binding. */
/* If the following bit is set in the MODE argument to `dlopen',
the symbols of the loaded object and its dependencies are made
visible as if the object were linked directly into the program. */
-#define RTLD_GLOBAL 0x0004
+#define RTLD_GLOBAL 0x00004
+/* 0x00100 Avoid. Generic RTLD_GLOBAL. */
/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
The implementation does this by default and so we can define the