From patchwork Tue Feb 9 17:18:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 41984 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 AD0313955414; Tue, 9 Feb 2021 17:18:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD0313955414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612891130; bh=Efgb5nyRNbser+n5s3wYXW882T5pGaetKYj14d4+yaw=; 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=jZI/nXT+Jj4xNYp2blQaifJXZ1e90DA7dQ7fX35ADXkPzN8XfRbtHfP3CySmo2gYQ N+AviUXxkGkZyLQEEMuHVT1Mx0yE/BF+ThsI8ptsw7af3Oc1LBnZ5pgtqF19DLCeuF 9fVSsRgxYLT+TWS8sdNmfYb2t9qMEdz1y/+GbiEk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by sourceware.org (Postfix) with ESMTPS id 9984638708C8 for ; Tue, 9 Feb 2021 17:18:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9984638708C8 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 D78A11F451D6 for ; Tue, 9 Feb 2021 17:18:45 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [RFC][PATCH v8 02/20] include/link.h: Update the link_map struct to allow proxies Date: Tue, 9 Feb 2021 17:18:21 +0000 Message-Id: <20210209171839.7911-3-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=-13.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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-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" 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 proxy. --- include/link.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/link.h b/include/link.h index 4af16cb596..b51fa0cbdf 100644 --- a/include/link.h +++ b/include/link.h @@ -107,8 +107,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 proxied into a namespace by dlmopen with RTLD_SHARED. */ struct link_map *l_real; /* Number of the namespace this link map belongs to. */ @@ -180,6 +181,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_proxy:1; /* Nonzero if object is a shallow copy. */ 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. */