From: "Vivek Das Mohapatra" <vivek@collabora.com>
To: libc-alpha <libc-alpha@sourceware.org>
Subject: [RFC][PATCH v6 18/20] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE dynamic section+flag to glibc DSOs
Date: Tue, 15 Dec 2020 18:44:58 +0000 [thread overview]
Message-ID: <20201215184500.25915-19-vivek@collabora.com> (raw)
In-Reply-To: <20201215184500.25915-1-vivek@collabora.com>
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(-)
diff --git a/Makeconfig b/Makeconfig
index 8074613b85..6ed137e2a3 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 ef0fe67d9a..ffb4f74de0 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 4ec2741cdc..121808a8fe 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 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
--
2.20.1
next prev parent reply other threads:[~2020-12-15 18:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 18:44 [RFC][PATCH v6 00/20] Implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 01/20] Declare and describe the dlmopen RTLD_SHARED flag Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 02/20] include/link.h: Update the link_map struct to allow proxies Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 03/20] elf/dl-object.c: Implement a helper function to proxy link_map entries Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 04/20] elf/dl-load.c, elf-dl-open.c: Implement RTLD_SHARED dlmopen proxying Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 05/20] elf/dl-fini.c: Handle proxy link_map entries in the shutdown path Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 06/20] elf/dl-init.c: Skip proxied link map entries in the dl init path Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 07/20] elf/dl-open.c: Don't try libc linit in namespaces with no libc mapping Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 08/20] elf/dl-open.c: when creating a proxy check the libc_map in NS 0 Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 09/20] Define a new dynamic section tag - DT_GNU_FLAGS_1 Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 10/20] Abstract the loaded-DSO search code into a private helper function Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 11/20] Compare loaded DSOs by file ID and check for DF_GNU_1_UNIQUE Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 12/20] Use the new DSO finder helper function since we have it Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 13/20] Use the DSO search helper to check for preloaded DT_GNU_UNIQUE DSOs Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 14/20] When loading DSOs into alternate namespaces check for DT_GNU_UNIQUE Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 15/20] Suppress audit calls when a (new) namespace is empty Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 16/20] Suppress inter-namespace DSO sharing for audit libraries Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 17/20] dlsym, dlvsym should be able to look up symbols via DSO proxies Vivek Das Mohapatra
2020-12-15 18:44 ` Vivek Das Mohapatra [this message]
2020-12-15 18:56 ` [RFC][PATCH v6 18/20] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE dynamic section+flag to glibc DSOs Samuel Thibault
2020-12-15 23:21 ` Vivek Das Mohapatra
2020-12-15 18:44 ` [RFC][PATCH v6 19/20] Add dlmopen / RTLD_SHARED tests Vivek Das Mohapatra
2020-12-15 18:45 ` [RFC][PATCH v6 20/20] Restore separate libc loading for the TLS/namespace storage test Vivek Das Mohapatra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201215184500.25915-19-vivek@collabora.com \
--to=vivek@collabora.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).