From patchwork Tue Feb 9 17:18:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 42000 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62F3B398C01B; Tue, 9 Feb 2021 17:19:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62F3B398C01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612891140; bh=c2JhLsxj9ijMQybPe286MY3cHE8bOoXQOuLzD0C5XHQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fvcHJBTPGpNb+ll2NOM53Qcjh3mJqNEvRzqzOREJouZA+ABf86bN/hTMmlqzN3wOp zQdUh6DuE72VLbT3Y0lRUSv2XuMmJYFGm2H73/L5yIcRkiY410v/0n/tWo6xT26RZv 8DBkQ5x+MufENSqHVigNcZDBjwrz4kCD1b/G43E4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by sourceware.org (Postfix) with ESMTPS id EA09A396AC02 for ; Tue, 9 Feb 2021 17:18:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EA09A396AC02 Received: from noise.lan (unknown [IPv6:2001:4d48:ad5c:ef00:8e70:5aff:fe59:c29c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id D62491F451E9 for ; Tue, 9 Feb 2021 17:18:46 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [RFC][PATCH v8 18/20] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE dynamic section+flag to glibc DSOs Date: Tue, 9 Feb 2021 17:18:37 +0000 Message-Id: <20210209171839.7911-19-vivek@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210209171839.7911-1-vivek@collabora.com> References: <20210209171839.7911-1-vivek@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra_via_Libc-alpha?= From: Vivek Dasmohapatra Reply-To: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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(-) diff --git a/Makeconfig b/Makeconfig index 0a4811b5e5..d0e52f26fd 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 ca9885436e..82adffdc27 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/htl/Makefile b/htl/Makefile index c15c1b194e..5d0d76d941 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -204,7 +204,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 diff --git a/iconvdata/Makefile b/iconvdata/Makefile index 55c527a5f7..ea5565eb40 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 8fb7fee6db..9090b88dec 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -349,7 +349,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