From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22073 invoked from network); 11 Apr 2022 15:52:43 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Apr 2022 15:52:43 -0000 Received: (qmail 19683 invoked by uid 550); 11 Apr 2022 15:52:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 19643 invoked from network); 11 Apr 2022 15:52:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TywPW/yh5h3xeAuc7IePYC/+gwWGdrHg9zxzrU0V3zc=; b=eYWP3gdeVz5gmw7DM72KCsPUVoqLAG3j8EStMheBICRqDFRN5fJetJ5AQojrUzIOCf qwzECtMSg37+lye2p3v4q2TwcybIyqaFNUcRYI0doYQfuHFva0/+nAReJGsc68DR+q+/ +ONZZUPZ33jPbR/GlGcDCQ4IDwO7QAM9YXuAoiSWvog94P4QSOnl4xrry1t3pQMb5ADI ylo1LVpM6yflvdvZ750KYdBtCzP7jZeBkrHQlCyzpHGYHUo0mKtNf7/5GWT/BgR7kLOF qbLof6GgKTnIPAttjeeVYW4s2+gq1Da0BhMl1MpwTuJEkKVmCYyvUoDV+vuPGjdXzHvi VsHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TywPW/yh5h3xeAuc7IePYC/+gwWGdrHg9zxzrU0V3zc=; b=XGc19cTsALtIT75xTiS2pTs3NGaWkzGe7fJEBFKaFnSkRQBap2bj0CBRwkpdmgPXSL jtFkZ5RJ+wrh/2ho8+Z1eRtTW9L/ay2ng6+cRSsBzb+EbbYFwLZ/1FsoB+DCCIZRYi6p sAwhkf+i84BnfuFFbXQJv3L5jlHnLGPdiScqHgekKA8ixU+WDkaMulHPbp0Kj/VzcliS W0pdmuBWu6Kg+tKv82urMta9C9Sbakhju3hqvk4wy8WSzDp6LpjuTsiVQmVQdyPb3jXc kntZD7TAbH349VMBQ8nldO36owwYRd+3a2e6EFB1yd3X/GnfJ1v2u+TCH73z8peuPwPs QJlw== X-Gm-Message-State: AOAM530PQp28YWG7PLaidCyEzRBfdxgRTVvUYWrycEd3ocbIdyMBqtIp 3/rL0kUrFt/5/pEJ5bfxTQmLBIZHcEoKNwHRt62QmA== X-Google-Smtp-Source: ABdhPJyTJeBO1bWEQ/2ioWMA/tVu5/H5StAyOAKrt+MsOvgD2jZsIVRK1UmJ8K+0szyQA+NupOHyHUiZqnRYXbTqVKs= X-Received: by 2002:a1f:d102:0:b0:345:b1af:81a2 with SMTP id i2-20020a1fd102000000b00345b1af81a2mr1160872vkg.5.1649692347421; Mon, 11 Apr 2022 08:52:27 -0700 (PDT) MIME-Version: 1.0 References: <20220405031859.17673-1-ccross@google.com> <20220411124218.GP7074@brightrain.aerifal.cx> In-Reply-To: From: Colin Cross Date: Mon, 11 Apr 2022 08:52:15 -0700 Message-ID: To: noloader@gmail.com Cc: Rich Felker , musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] [PATCH] dl_iterate_phdr: return empty string for the name of the main program On Mon, Apr 11, 2022 at 7:03 AM Jeffrey Walton wrote: > > On Mon, Apr 11, 2022 at 8:42 AM Rich Felker wrote: > > > > On Mon, Apr 11, 2022 at 08:24:21AM -0400, Jeffrey Walton wrote: > > > On Mon, Apr 4, 2022 at 11:57 PM Michael Forney wrote: > > > > > > > > ... > > > > > Use a constant empty string instead of the DSO name field for the first > > > > > entry in the DSO list. > > > > > > > > I believe glibc is the exception here, not musl. When I looked at > > > > this, every other operating system I tried used the program name for > > > > the first object. > > > > > > I may be splitting hairs, but the dl_iterate_phdr(3) man page does not > > > say a program is returned during the enumeration. It says shared > > > objects are returned. > > > > You are. The intent, actual practice -- and absolute necessity for > > this function to serve its purpose, which includes admiting the > > implementation of exception handling -- is that it be included. And in > > this context, the (dynamic linked) program *is* a shared object. > > I think you are conflating ET_DYN with a shared object. The presence > of ET_DYN does not make a program a shared object, it merely means the > object is relocatable (i.e., position independent code). > > Jeff >From further down in the same man page: The first object visited by callback is the main program. For the main program, the dlpi_name field will be an empty string. In any case, the motivation for this patch was for compatibility with LLVM's ASAN runtime, which has now been fixed to remove the empty name assumption by Michael's resubmitted patch at https://reviews.llvm.org/D119515, so this patch is no longer necessary.