From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6876 invoked by alias); 25 Mar 2005 20:51:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6857 invoked from network); 25 Mar 2005 20:51:27 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 25 Mar 2005 20:51:27 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DEvml-0006kK-BO for ; Fri, 25 Mar 2005 15:52:03 -0500 Date: Fri, 25 Mar 2005 20:51:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [rfa] Skip "special" symbols when reading minimal symbols Message-ID: <20050325205203.GA25765@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20050309173557.GA17136@nevyn.them.org> <4230E1E3.5080605@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4230E1E3.5080605@redhat.com> User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-03/txt/msg00320.txt.bz2 On Thu, Mar 10, 2005 at 04:10:11PM -0800, Michael Snyder wrote: > Daniel Jacobowitz wrote: > >Nick recently introduced a hook in bfd to allow a target to mark a symbol > >as > >"special". What exactly "special" means isn't well defined, except that > >they are not normal symbols, and objdump and nm will decline to display > >them > >unless an additional command line option is given. So, I would like to > >make > >that the default behavior in GDB also. > > > >GDB could make use of special symbols in a target-specific fashion - in > >this > >case, to build up a PC -> ISA mapping. The most logical way to do this > >would be to call a gdbarch hook for special symbols (or for all symbols?). > >But we don't need that yet, so I haven't added the hook. > > > >The advantage of skipping the mapping symbols is that they generally occur > >at the same addresses as other non-mapping symbols. This causes GDB to > >show > >"$a" in disassembly instead of "main" in some cases (depending on the > >vagaries of hashing). Whatever target-specific meaning a special symbol > >may > >have, the BFD hook indicates that it isn't a standard symol, so I think > >it's > >appropriate to skip it in GDB. > > > >Is this patch OK? Fixes a number of testsuite failures on arm-linux and > >arm-netbsd. > > > > I assume, if the hook is defined, you would just call it before (or > instead of) skipping the symbol? Maybe the hook return value (true > or false) could tell elfread whether to skip the symbol or save it? > In case it might be useful later? Yes, precisely. > I think the idea is sound, but since I've no idea what these are > intended for (currently or in the future), it's hard to say whether > defaulting to omit them is the right thing. The only current user is the one I described above: ARM binaries contain $a (ARM), $t (THUMB), and $d (data) markers in their symbol table. I definitely want these omitted, since they otherwise show up as function names in disassembly. Meanwhile, I've committed this pending patch to csl-arm-20050325-branch. -- Daniel Jacobowitz CodeSourcery, LLC