From patchwork Mon Mar 30 17:42:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 38661 Return-Path: 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 7AE8C385DC0D for ; Mon, 30 Mar 2020 17:42:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7AE8C385DC0D Received: from noise.collabora.co.uk (unknown [IPv6:2a00:5f00:102:0:c0a7:51ff:feaf:e642]) (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 24E9A2966C4; Mon, 30 Mar 2020 18:42:16 +0100 (BST) From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= To: vivek@etla.org, libc-alpha@sourceware.org Subject: [RFC][PATCH 3/6] Document DF_1_UNIQUE in the man page and ld help output Date: Mon, 30 Mar 2020 18:42:04 +0100 Message-Id: <736af5b6e404f4b65c00a6f4914c8f2830bb81af.1585587351.git.vivek@collabora.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-33.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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-List-Received-Date: Mon, 30 Mar 2020 17:42:18 -0000 --- ld/ld.texi | 7 +++++++ ld/lexsup.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ld/ld.texi b/ld/ld.texi index 9f562935be..af7dfcbb41 100644 --- a/ld/ld.texi +++ b/ld/ld.texi @@ -1271,6 +1271,13 @@ Specify that the dynamic loader should modify its symbol search order so that symbols in this shared library interpose all other shared libraries not so marked. +@item unique +When generating a shared library or other dynamically loadable ELF object +mark it as one that should only ever be loaded once, and only in the main +namespace (when using @code{dlmopen}). This is primarily used to mark +fundamental libraries such as libc, libpthread et al which cannot function +correctly unless they are the sole instances of themselves. + @item lazy When generating an executable or shared library, mark it to tell the dynamic linker to defer function call resolution to the point when diff --git a/ld/lexsup.c b/ld/lexsup.c index 2597e2d630..3876b922f4 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1806,6 +1806,8 @@ elf_shlib_list_options (FILE *file) fprintf (file, _("\ -z interpose Mark object to interpose all DSOs but executable\n")); fprintf (file, _("\ + -z unique Mark DSO to be loaded at most once, and only in the main namespace\n")); + fprintf (file, _("\ -z lazy Mark object lazy runtime binding (default)\n")); fprintf (file, _("\ -z loadfltr Mark object requiring immediate process\n"));