From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30610 invoked by alias); 1 Jul 2005 10:52:44 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30591 invoked by uid 22791); 1 Jul 2005 10:52:41 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 01 Jul 2005 10:52:41 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DoJ0b-0001sa-Fm for gdb@sources.redhat.com; Fri, 01 Jul 2005 12:44:33 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2005 12:44:33 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2005 12:44:33 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: A quick question about high/low_pc and linkonce sections Date: Fri, 01 Jul 2005 10:52:00 -0000 Message-ID: References: <6f48278f05070103134baa0b90@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-07/txt/msg00001.txt.bz2 Jie Zhang wrote: > Hi, > > This is a piece of code from dwarf2read.c, near the end of > dwarf2_get_pc_bounds (). > > /* When using the GNU linker, .gnu.linkonce. sections are used to > eliminate duplicate copies of functions and vtables and such. > The linker will arbitrarily choose one and discard the others. > The AT_*_pc values for such functions refer to local labels in > these sections. If the section from that file was discarded, the > labels are not in the output, so the relocs get a value of 0. > If this is a discarded function, mark the pc bounds as invalid, > so that GDB will ignore it. */ > if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0) > return 0; > > > Isn't "high == 0" much better than "low == 0"? It's possible that a > valid DW_AT_low_pc is 0. For the record, I've run into this problem myself and had to patch it around. For my target, "lowpc" is always 0. Also, the same logic is present at the end of the read_partial_die function. - Volodya