From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104321 invoked by alias); 19 Mar 2019 14:35:52 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 104312 invoked by uid 89); 19 Mar 2019 14:35:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.0 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.3.1 spammy=koutn=c3=bd, jirka, Koutn=c3=bd, Koutn?= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Mar 2019 14:35:50 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6FqG-0006FX-Ob for gdb@sourceware.org; Tue, 19 Mar 2019 10:35:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43605) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h6FqG-0001eL-Ek for gdb@gnu.org; Tue, 19 Mar 2019 10:35:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6FqF-0006DT-Kc for gdb@gnu.org; Tue, 19 Mar 2019 10:35:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3940) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6FqF-0006AD-76 for gdb@gnu.org; Tue, 19 Mar 2019 10:35:47 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 890142D813; Tue, 19 Mar 2019 14:35:45 +0000 (UTC) Received: from host1.jankratochvil.net (unknown [10.36.118.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8CF6605CB; Tue, 19 Mar 2019 14:35:44 +0000 (UTC) Date: Tue, 19 Mar 2019 14:35:00 -0000 From: Jan Kratochvil To: Jirka =?utf-8?Q?Koutn=C3=BD?= Cc: gdb@gnu.org Subject: Re: question about why gdb needs executable's binary Message-ID: <20190319143542.GA3498328@host1.jankratochvil.net> References: <20190314214555.GA2221061@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-SW-Source: 2019-03/txt/msg00053.txt.bz2 On Tue, 19 Mar 2019 15:25:15 +0100, Jirka Koutn=C3=BD wrote: > PT_NOTE can't be read by gdb, Various PT_NOTESs are read by GDB but not PT_NOTE of type NT_FILE. > That being said, how about dlopen()? That does not matter, both initially-loaded libraries and dlopen()ed librar= ies are present in DT_DEBUG/_r_debug/r_debug the same way. "initially-loaded library" (which is linked automatically, during compilati= on specified by -lNAME) are present in DT_NEEDED but that is for ld.so (/lib64/ld-linux-x86-64.so.2) and GDB does not care about those. It would be nice if GDB did but that is an unrelated RFE: RFE: preload DT_NEEDED library list https://sourceware.org/bugzilla/show_bug.cgi?id=3D12249 > For what I found out about DT_DEBUG this section gets initialized by ld as by ld.so (/lib64/ld-linux-x86-64.so.2), not /usr/bin/ld. > you said. Do I understand you correctly, this is an alternative to the > first option, that in fact doesn't require the executable? yes, sort of alternative. But NT_FILE is generated by kernel so there can appear even shared libraries mmap()ed as data files while in DT_DEBUG/_r_debug/r_debug can be found only libraries really opened by DT_NEEDED or dlopen()ed. So there is a subtle difference what those two sources of information mean. Also NT_FILE is generated only by Linux kernel (or GDB) while DT_DEBUG/_r_debug/r_debug are present even on non-Linux UNIXes (if one thinks there still exist some). Jan