From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8B2561F8C6 for ; Mon, 9 Aug 2021 20:37:54 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5F4E3938C25 for ; Mon, 9 Aug 2021 20:37:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5F4E3938C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628541473; bh=xoY9k8V3avlsGUIQvvJDJMitTeD5kIj/HkpSObEbqlw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tzte4lUmglCBJz83kDtjbB/h/pL4Rhl8YdzlRfdunyTCVDkyfnjCTL5w2sHbu2aFM hETTwjw5xzojYxFrNmmrx1I6zH7tOFBot+wTe0KAJMLEiubZ977bV4mUsik5qZ4Y6M 7hBR9uXfD5eIRVmMJFTz/NROr9VLwswZAI2WbuGg= Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 048C23939C22 for ; Mon, 9 Aug 2021 20:35:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 048C23939C22 Received: by mail-pj1-x1031.google.com with SMTP id cp15-20020a17090afb8fb029017891959dcbso842792pjb.2 for ; Mon, 09 Aug 2021 13:35:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xoY9k8V3avlsGUIQvvJDJMitTeD5kIj/HkpSObEbqlw=; b=AGpAyj2L+HnZVmxDJzXoiCl7VhhJ+8rj0fVMxrVG/oWZSuiWdpN4X536nLDp+JTbpu KB8s7nLqJroEAAWBzY8yVOpvw1xEMiQHpAq3pLLu5xt7NGmDHUqamTUIBgKWfvKrmrdl SR7YnJOIdQtvPMTOLv4Zhbdt6auFnQ6vf9/IudeuqU4X4EeDZLfQCYG0+WBPUJEVySr9 WiVvt+RWHN6a97aP7OLp1183si0hwd/NKVK0b2zAS4QDz2SheW7Xs2gv+R78Y8m3k3r0 83JPmbEUyXxyoQUnt0goPB2Mq0TSvfY2yvtHiJth+3Z3Z2rz1Dqx7+AVCokePXtkyBnf 0LtQ== X-Gm-Message-State: AOAM5319MmzmAhQHa52zjVk77jdUq0bvzb6yKRN/iwagLnrirWNsW5GU 38VSPzoEH5Uz6Ae4c63jfBfqTQ05jp51lQ== X-Google-Smtp-Source: ABdhPJw1n3Bxc291/7VZ84hI0x94LzJi2SojcX080JUGM1iZo839TaZgfUEQCqWpjwYH0dHVz+MrnA== X-Received: by 2002:a65:615a:: with SMTP id o26mr944942pgv.177.1628541299958; Mon, 09 Aug 2021 13:34:59 -0700 (PDT) Received: from ?IPv6:2804:431:c7cb:9dce:a96c:8a7f:2ffc:f373? ([2804:431:c7cb:9dce:a96c:8a7f:2ffc:f373]) by smtp.gmail.com with ESMTPSA id 129sm16492271pfg.50.2021.08.09.13.34.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 13:34:59 -0700 (PDT) Subject: Re: [RFC][PATCH v12 0/8] Implementation of RTLD_SHARED for dlmopen To: Vivek Das Mohapatra , libc-alpha@sourceware.org References: <20210708163255.812-1-vivek@collabora.com> Message-ID: Date: Mon, 9 Aug 2021 17:34:57 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210708163255.812-1-vivek@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 08/07/2021 13:32, Vivek Das Mohapatra via Libc-alpha wrote: > This is a revision of a previous patchset that I posted here > regarding https://sourceware.org/bugzilla/show_bug.cgi?id=22745 > > Introduction: > > ======================================================================= > As discussed in the URL above dlmopen requires a mechanism for > [optionally] sharing some objects between more than one namespace. > > The following patchset provides an implementation for this: If an > object is loaded with the new RTLD_SHARED flag we instead ensure > that a "master" copy exists (and is flagged as no-delete) in the > main namespace and a thin wrapper or clone is placed in the target > namespace. > > This patch series should address all the comments received on the > earlier (v1-v10) series. > > ======================================================================= > > Changes from v11: > > - If a DSO is required in a non-base namespace because it is mentioned > in a DT_NEEDED entry and it is itself flagged DF_GNU_1_UNIQUE then > a proxy is generated for it. > > - Relocations via non-base namespace proxies work reliably (some code > paths did not do the address calculation relative to the DSO base > correctly when a proxy was involved). > > - Tests extended cover the above two scenarios. > > Changes from v10: > > - A segfault in a dlmopen error pathway (which does not seem to have existed > when v10 was applied to the then-HEAD commit) has been fixed. > > - The fallback mechanism for adding DT_GNU_FLAGS_1 sections to the required > binaries has had some infrastructure moved to the elf/ directory > > - The runstatedir setting introduced by recent autoconf has been omitted from > the patchset as it is not relevant to this feature. > > - libpthread no longer tagged DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE. > (with both -z unique supporting linkers and if the .os hack is > used to add the new flag - this was inconsistent before). > > Not changed: > > - There is still some diagnostic info in the config.log when the linker > layout is acceptable but -z unique is not yet supported. I believe this > _is_ useful diagnostic information as a developer might otherwise wonder > why the vanilla linker was being rejected when its layout output seemed > fine. > > I have not yet implemented, but plan to address once this series is > accepted/acceptable: > > - dl_iterate_ns_phdr (cf dl_iterate_phdr but taking a namespace argument) > > - Check RTLD_GLOBAL interacts properly and unsurprisingly with RTLD_SHARED. Hi Vivek, This patchset looks much better than before, I have added my comments on the set. There are some spots that need rework, like some patches that should be merged, some style fixes, and testcase; but in general I think we can move forward. I have fixed all my remarks on a personal branch [1] and checked on both x86_64-linux-gnu and i686-linux-gnu with binutils with and without DT_GNU_FLAGS_1 support. If you are ok with my changes, please report the patches without the RFC so I can ack them and I will push them upstream. Thanks for working on this. [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/rtld-shared