libc.so, libpthread.so etc should have the new unique-dso-by-default
flag set to allow dlmopen to work better (libc et al instance shared
by default when DSOs dlmopened into a new namespace).
---
Makeconfig | 1 +
Makerules | 2 +-
htl/Makefile | 2 +-
iconvdata/Makefile | 1 +
nptl/Makefile | 2 +-
5 files changed, 5 insertions(+), 3 deletions(-)
@@ -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
@@ -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.
@@ -205,7 +205,7 @@ $(inst_libdir)/libpthread_syms.a: $(srcdir)/libpthread_syms.a $(+force)
libc-link.so = $(common-objpfx)libc.so
extra-B-pthread.so = -B$(common-objpfx)htl/
-LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
+LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,unique,-z,nodelete,-z,initfirst
include ../Rules
@@ -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))
@@ -354,7 +354,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,unique,-z,nodelete,-z,initfirst
tests += tst-cancelx7 tst-cancelx17 tst-cleanupx4