From patchwork Wed Dec 16 13:26:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 41449 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 3FC93383E80F; Wed, 16 Dec 2020 13:27:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FC93383E80F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608125274; bh=jRVNkUBiH1Quiqd+1h/R82nHpjgXX8anlNLgXUprz0A=; 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=Z6J0/iHkd/nD/5oXFGoHde9H9pv3N379JzZUTFDLY2UqNaRgSNyW5DJ9ZKjiV3+/q REWDlthvv57GNv7rxAZAJnJsozpmUXAjmNWSjbrcnqDIlL87TsaNG9fVaFCQpAfga5 Os1yXWuJKRsA5qaANyPQeATB6jpoo8ztpk/wtiEw= 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 513D83840C17 for ; Wed, 16 Dec 2020 13:27:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 513D83840C17 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 90A821F45674 for ; Wed, 16 Dec 2020 13:27:42 +0000 (GMT) To: libc-alpha Subject: [RFC][PATCH v7 06/20] elf/dl-init.c: Skip proxied link map entries in the dl init path Date: Wed, 16 Dec 2020 13:26:36 +0000 Message-Id: <20201216132650.22949-7-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=-13.5 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" Proxies should not trigger calls to DT_INIT constructors since they're just shims that point to the real, already loaded and initialised, objects. --- elf/dl-init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/dl-init.c b/elf/dl-init.c index 518824e8a5..11b00641a6 100644 --- a/elf/dl-init.c +++ b/elf/dl-init.c @@ -34,8 +34,8 @@ call_init (struct link_map *l, int argc, char **argv, char **env) need relocation, and neither do proxy objects.) */ assert (l->l_real->l_relocated || l->l_real->l_type == lt_executable); - if (l->l_init_called) - /* This object is all done. */ + if (l->l_init_called || l->l_proxy) + /* This object is all done, or a proxy (and therefore initless). */ return; /* Avoid handling this constructor again in case we have a circular