diff mbox series

[RFC,v4,15/15] Add the DT_FLAGS_1 DF_1_UNIQUE flag to the glibc cluster

Message ID 495b0fbda24bb35925d7cd81b05cce43016abf0d.1585588166.git.vivek@collabora.com
State New
Headers show
Series Proof-of-Concept implementation of RTLD_SHARED for dlmopen | expand

Commit Message

develop--- via Libc-alpha March 30, 2020, 5:43 p.m. UTC
---
 Makeconfig         | 1 +
 Makerules          | 2 +-
 iconvdata/Makefile | 1 +
 nptl/Makefile      | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/Makeconfig b/Makeconfig
index f252842979..269050633c 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -398,6 +398,7 @@  LDFLAGS-lib.so += -Wl,-z,now
 # Extra flags for dynamically linked non-test main programs.
 link-extra-flags += -Wl,-z,now
 endif
+LDFLAGS-lib.so += -Wl,-z,unique
 
 # Command to run after every final link (executable or shared object).
 # This is invoked with $(call after-link,...), so it should operate on
diff --git a/Makerules b/Makerules
index 1e9c18f0d8..dccd9e3c54 100644
--- a/Makerules
+++ b/Makerules
@@ -635,7 +635,7 @@  build-shlib-objlist = $(build-module-helper-objlist) \
 # Don't try to use -lc when making libc.so itself.
 # Also omits crti.o and crtn.o, which we do not want
 # since we define our own `.init' section specially.
-LDFLAGS-c.so = -nostdlib -nostartfiles
+LDFLAGS-c.so = -nostdlib -nostartfiles -Wl,-z,unique
 # But we still want to link libc.so against $(libc.so-gnulib).
 LDLIBS-c.so += $(libc.so-gnulib)
 # Give libc.so an entry point and make it directly runnable itself.
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index c83962f351..338c8d0ff0 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -67,6 +67,7 @@  modules	:= ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5		 \
 ifeq ($(bind-now),yes)
 LDFLAGS.so += -Wl,-z,now
 endif
+LDFLAGS.so += -Wl,-z,unique
 
 modules.so := $(addsuffix .so, $(modules))
 
diff --git a/nptl/Makefile b/nptl/Makefile
index 584e0ffd96..8647a87da9 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -380,7 +380,7 @@  else
 tests-printers-libs := $(static-thread-library)
 endif
 
-LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
+LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst,-z,unique
 
 # GCC-4.9 compiles 'sprintf(NULL, ...)' into UD2 on x86_64 without -fno-builtin
 CFLAGS-tst-cleanup2.c += -fno-builtin