From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46875 invoked by alias); 25 Apr 2019 13:46:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 46867 invoked by uid 89); 25 Apr 2019 13:46:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=qc, CONTENTS X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 13:46:25 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 7222B400D5E5C for ; Thu, 25 Apr 2019 08:46:24 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id JehkhWp2VYTGMJehkhciof; Thu, 25 Apr 2019 08:46:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ViQYzA8QTA5JeGdbrnoKtit9OKoe3VDNb7P1jwhEzOo=; b=Dm8ncp2bnrf/k+Q98RsYNpLPou /Qa58iSD14brDC2xjVK5VQxc/u0r0PUY1jLlljhk8fZHaqAhCTy6ellcs8g2EuoZvtleSiauYsakl 2P1whBxUnOWcgbWgQwRA3DB2b; Received: from 97-122-168-123.hlrn.qwest.net ([97.122.168.123]:55812 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hJehk-000BAk-5h; Thu, 25 Apr 2019 08:46:24 -0500 From: Tom Tromey To: Eli Zaretskii Cc: Tom Tromey , lrn1986@gmail.com, gdb-patches@sourceware.org Subject: Re: Warning when using separate debug info file References: <83y348edoi.fsf@gnu.org> <20439f48-c0ff-e4b2-5cfc-6bb4b594d88c@gmail.com> <83h8aveape.fsf@gnu.org> <66d48dfd-23ac-7e05-3ad8-4e65b0c1c7f9@gmail.com> <834l6vdv4y.fsf@gnu.org> <87k1fjfbio.fsf@tromey.com> <83mukf19dl.fsf@gnu.org> Date: Thu, 25 Apr 2019 13:46:00 -0000 In-Reply-To: <83mukf19dl.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Apr 2019 22:38:46 +0300") Message-ID: <87y33yci4w.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-04/txt/msg00516.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> So you are saying that if you create a separate debug info file with Eli> .gnu_debuglink on GNU/Linux, then GDB will display the same warning Eli> when debugging the stripped binary? I think someone said this didn't Eli> happen on GNU/Linux. I tried and it doesn't give a warning. I did this with a simple test program: gcc -g -o q q.c -Wl,--build-id=none objcopy --only-keep-debug q q.debug strip -g q objcopy --add-gnu-debuglink=q.debug q Then in gdb: (gdb) file ./q Reading symbols from ./q...Reading symbols from /tmp/q.debug...done. done. >> So I suppose this is just a bug but the cause remains unknown. Eli> The place where this happens, addr_info_make_relative, maps addresses Eli> to BFD addresses, and I wonder why .gnu_debuglink appears in the array Eli> of sections the GDB looks up in the separate debug file. Any ideas Eli> why this happens? Try looking at the section headers: $ objdump -h -j .gnu_debuglink q q: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 25 .gnu_debuglink 0000000c 0000000000000000 0000000000000000 000013cc 2**2 CONTENTS, READONLY I don't recall which but probably the section is either loadable or allocatable in your situation. Tom