From patchwork Mon Aug 20 13:54:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 959722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-95389-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="xT+3Arqv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vFgg2bLsz9s5c for ; Mon, 20 Aug 2018 23:55:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:in-reply-to:references; q=dns; s=default; b=vGwVywEi 9d0UxIU6cIgjjZ+8XaGRtp024HinK05icFFbeyBdrjFDmXz2ye8BI72eeOl9nBS5 kAs4BW2OJg/1nI2MyGCxPFomODff7uQkZ0r6oZjQ2GlLGtoObYYSQU2fWXULPLE8 ytDnFligmv01t5YOCVUa4S9+pctTWpfn6Sc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:in-reply-to:references; s=default; bh=p9uaDn4lJYL/4m G1/IyU3DhPE9g=; b=xT+3ArqvvJb6dXXjYKJf2cra+l9Ysrgmc1/atewasef3hO 61NQRrVYV/JAfQTAX+yHoWu5cIINm7XktZRXIudT2IcLQElZtOzaPzK3Gq2OvF5f /oU07eGVhv2zIYj3CqEzyjK9d+0ZjCd1iLGFXq16+LLPbtHHROCOuKywAsSdE= Received: (qmail 44165 invoked by alias); 20 Aug 2018 13:54:50 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 44044 invoked by uid 89); 20 Aug 2018 13:54:49 -0000 Authentication-Results: sourceware.org; auth=none 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=Hx-languages-length:827 X-HELO: bhuna.collabora.co.uk From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= To: libc-alpha@sourceware.org Subject: [RFC][PATCH v3 6/6] elf/dl-init.c: Skip proxied link map entries in the dl init path Date: Mon, 20 Aug 2018 14:54:31 +0100 Message-Id: <3aa275e3eca35f83909137c41a60af9b58e794f0.1534532485.git.vivek@collabora.com> In-Reply-To: References: In-Reply-To: References: 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 3e72fa3013..2533afa042 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