From patchwork Wed Dec 16 13:26:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 41458 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 4C99E3836C63; Wed, 16 Dec 2020 13:28:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C99E3836C63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608125280; bh=uTRoiruRbSECEaQcDg7SsDaF4m0mRdoghXKeQ6tZMaI=; 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=xy/JXUXWTQb87Rl16RITDuYE2rrq7ypH7DjVvHeGgNncmwCod/8sUq8Frf/zwPUOJ bsZKlaT0vEiqm2N9Pq6MnBNPqjtWbGcYMtf2XSTHogJT/D+8VBC83lnpYsDiFxOu5n YAZ/cuDNAosxxQModJtp7yO5X7FS5egA9YKt3XRQ= 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 434D83840C17 for ; Wed, 16 Dec 2020 13:27:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 434D83840C17 Received: from noise.cbg.collabora.co.uk (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 D46441F456A7 for ; Wed, 16 Dec 2020 13:27:46 +0000 (GMT) To: libc-alpha Subject: [RFC][PATCH v7 18/20] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE dynamic section+flag to glibc DSOs Date: Wed, 16 Dec 2020 13:26:48 +0000 Message-Id: <20201216132650.22949-19-vivek@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201216132650.22949-1-vivek@collabora.com> References: <20201216132650.22949-1-vivek@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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 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/htl/Makefile b/htl/Makefile index 326a920fb3..509af4ba7a 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -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 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