[RFC,v4,07/15] Define a new DT_FLAGS_1 flag - DF_1_UNIQUE

Message ID e14a7feb4ab15b13fec7b597655f69159b6cad86.1585588166.git.vivek@collabora.com
State New
Headers show
Series
  • Proof-of-Concept implementation of RTLD_SHARED for dlmopen
Related show

Commit Message

Sergei Trofimovich via Libc-alpha March 30, 2020, 5:43 p.m.
We expect this flag to be set on ELF DSOs that should only
ever have one instance across all link map namespaces.

libc and its constituent DSOs should have this flag set.
---
 elf/elf.h     | 1 +
 include/elf.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.11.0

Patch

diff --git a/elf/elf.h b/elf/elf.h
index 2549a177d6..e0876b5701 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -997,6 +997,7 @@  typedef struct
 #define	DF_1_KMOD       0x10000000
 #define	DF_1_WEAKFILTER 0x20000000
 #define	DF_1_NOCOMMON   0x40000000
+#define	DF_1_UNIQUE     0x80000000      /* Object should exist at most once */
 
 /* Flags for the feature selection in DT_FEATURE_1.  */
 #define DTF_1_PARINIT	0x00000001
diff --git a/include/elf.h b/include/elf.h
index 14ed67ff67..ebcae81522 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -23,7 +23,7 @@ 
 # endif
 # define DT_1_SUPPORTED_MASK \
    (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
-    | DF_1_ORIGIN | DF_1_NODEFLIB | DF_1_PIE)
+    | DF_1_ORIGIN | DF_1_NODEFLIB | DF_1_PIE | DF_1_UNIQUE)
 
 #endif /* !_ISOMAC */
 #endif /* elf.h */