From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18918 invoked by alias); 5 Apr 2018 17:52:41 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 18868 invoked by uid 89); 5 Apr 2018 17:52:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=reserved X-HELO: bhuna.collabora.co.uk Received: from bhuna.collabora.co.uk (HELO bhuna.collabora.co.uk) (46.235.227.227) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Apr 2018 17:52:39 +0000 Received: from noise.collabora.co.uk (unknown [IPv6:2a00:5f00:102:0:21e1:4ee1:a25:9887]) (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 96ABF2753C7 for ; Thu, 5 Apr 2018 18:52:37 +0100 (BST) From: =?UTF-8?q?Vivek=20Das=C2=A0Mohapatra?= To: libc-help@sourceware.org Subject: [RFC PATCH 2/5] include/link.h: Update the link_map struct to allow clones Date: Thu, 05 Apr 2018 17:52:00 -0000 Message-Id: <20180405175231.14757-3-vivek@collabora.com> In-Reply-To: <20180405175231.14757-1-vivek@collabora.com> References: <20180405175231.14757-1-vivek@collabora.com> X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00003.txt.bz2 We already have an l_real pointer, used for a similar purpose by the linker for copies of ld.so in secondary namespaces. Update its documentation and add a bitfield to indicate when link_map entry is a clone. --- include/link.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/link.h b/include/link.h index 5924594548..e051b5cd36 100644 --- a/include/link.h +++ b/include/link.h @@ -104,8 +104,9 @@ struct link_map They may change without notice. */ /* This is an element which is only ever different from a pointer to - the very same copy of this type for ld.so when it is used in more - than one namespace. */ + the very same copy of this type when: + - A shallow copy of ld.so is placed in namespaces other than LM_ID_BASE. + - An object is cloned into a namespace by dlmopen with RTLD_SHARED. */ struct link_map *l_real; /* Number of the namespace this link map belongs to. */ @@ -177,6 +178,7 @@ struct link_map unsigned int l_relocated:1; /* Nonzero if object's relocations done. */ unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */ unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */ + unsigned int l_clone:1; /* Nonzero if object is a clone. */ unsigned int l_reserved:2; /* Reserved for internal use. */ unsigned int l_phdr_allocated:1; /* Nonzero if the data structure pointed to by `l_phdr' is allocated. */ -- 2.11.0