From patchwork Mon Mar 30 17:43:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 38671 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 7778D385E03C for ; Mon, 30 Mar 2020 17:43:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7778D385E03C 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 8EAD92966E4; Mon, 30 Mar 2020 18:43:57 +0100 (BST) From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= To: vivek@etla.org, libc-alpha@sourceware.org Subject: [RFC][PATCH v4 06/15] elf/dl-init.c: Skip proxied link map entries in the dl init path Date: Mon, 30 Mar 2020 18:43:40 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-27.4 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:44:00 -0000 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 55d528c7a5..2eef584cf9 100644 --- a/elf/dl-init.c +++ b/elf/dl-init.c @@ -27,8 +27,8 @@ typedef void (*init_t) (int, char **, char **); static void call_init (struct link_map *l, int argc, char **argv, char **env) { - 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