From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 67D373857B86 for ; Wed, 31 Aug 2022 06:42:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 67D373857B86 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-67-RNwhQ_P8Osqg9kHx0rxvoA-1; Wed, 31 Aug 2022 02:42:10 -0400 X-MC-Unique: RNwhQ_P8Osqg9kHx0rxvoA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D0AC101AA46; Wed, 31 Aug 2022 06:42:10 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 874EEC15BB3; Wed, 31 Aug 2022 06:42:09 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539) References: <20220830163905.2578396-1-adhemerval.zanella@linaro.org> Date: Wed, 31 Aug 2022 08:42:07 +0200 In-Reply-To: <20220830163905.2578396-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Tue, 30 Aug 2022 13:39:05 -0300") Message-ID: <87r10w3oe8.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Wed, 31 Aug 2022 06:42:13 -0000 Message-ID: <20220831064207.DMTnqMsih390XX9B5DFS5oe9gJ1veK8Q2Fj32ccuph4@z> * Adhemerval Zanella via Libc-alpha: > The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like > dependencies are printed, instead of just the name and address it > follows other libraries mode and prints 'name => path'. > > Unfortunately, this broke some ldd consumer that uses the output to > filter out the program's dependencies. For instance CMake > bundleutilities module [1], where GetPrequirite uses the regex to filter > out 'name => path' [2]. > > This patch restore the previous way to print just the name and the > mapping address. > > Checked on x86_64-linux-gnu. > > [1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities > [2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733 > --- > elf/rtld.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/elf/rtld.c b/elf/rtld.c > index cbbaf4a331..3e771a93d8 100644 > --- a/elf/rtld.c > +++ b/elf/rtld.c > @@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr, > if (l->l_faked) > /* The library was not found. */ > _dl_printf ("\t%s => not found\n", l->l_libname->name); > + else if (strcmp (l->l_libname->name, l->l_name) == 0) > + /* Print vDSO like libraries without duplicate name. Some > + consumers depend of this format. */ > + _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name, > + (int) sizeof l->l_map_start * 2, > + (size_t) l->l_map_start); > else > _dl_printf ("\t%s => %s (0x%0*Zx)\n", > DSO_FILENAME (l->l_libname->name), Looks okay, thanks. Reviewed-by: Florian Weimer Florian