[RFC,v6,18/20] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE dynamic section+flag to glibc DSOs
Commit Message
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 +-
iconvdata/Makefile | 1 +
nptl/Makefile | 2 +-
4 files changed, 4 insertions(+), 2 deletions(-)
Comments
Hello,
Vivek Das Mohapatra via Libc-alpha, le mar. 15 déc. 2020 18:44:58 +0000, a ecrit:
> 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).
> ---
> diff --git a/nptl/Makefile b/nptl/Makefile
> index ddd83dfbdd..314931cbaa 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -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
Please also do the same in htl/Makefile
Samuel
>> -LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
>> +LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,unique,-z,nodelete,-z,initfirst
> Please also do the same in htl/Makefile
> Samuel
Building and running tests, will send new series tomorow.
@@ -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.
@@ -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