* [rfa] Skip "special" symbols when reading minimal symbols
@ 2005-03-09 17:36 Daniel Jacobowitz
2005-03-11 0:10 ` Michael Snyder
2006-02-20 17:32 ` Daniel Jacobowitz
0 siblings, 2 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-03-09 17:36 UTC (permalink / raw)
To: gdb-patches, Elena Zannoni
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.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-03-09 Daniel Jacobowitz <dan@codesourcery.com>
* elfread.c (elf_symtab_read): Skip symbols which BFD considers
special.
Index: gdb/elfread.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/elfread.c,v
retrieving revision 1.50
diff -u -p -r1.50 elfread.c
--- gdb/elfread.c 21 Feb 2005 11:00:44 -0000 1.50
+++ gdb/elfread.c 9 Mar 2005 17:24:30 -0000
@@ -203,6 +203,12 @@ elf_symtab_read (struct objfile *objfile
continue;
}
+ /* Skip "special" symbols, e.g. ARM mapping symbols. These are
+ symbols which do not correspond to objects in the symbol table,
+ but have some other target-specific meaning. */
+ if (bfd_is_target_special_symbol (objfile->obfd, sym))
+ continue;
+
offset = ANOFFSET (objfile->section_offsets, sym->section->index);
if (dynamic
&& sym->section == &bfd_und_section
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfa] Skip "special" symbols when reading minimal symbols
2005-03-09 17:36 [rfa] Skip "special" symbols when reading minimal symbols Daniel Jacobowitz
@ 2005-03-11 0:10 ` Michael Snyder
2005-03-25 20:51 ` Daniel Jacobowitz
2006-02-20 17:32 ` Daniel Jacobowitz
1 sibling, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2005-03-11 0:10 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, Elena Zannoni
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?
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfa] Skip "special" symbols when reading minimal symbols
2005-03-11 0:10 ` Michael Snyder
@ 2005-03-25 20:51 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-03-25 20:51 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfa] Skip "special" symbols when reading minimal symbols
2005-03-09 17:36 [rfa] Skip "special" symbols when reading minimal symbols Daniel Jacobowitz
2005-03-11 0:10 ` Michael Snyder
@ 2006-02-20 17:32 ` Daniel Jacobowitz
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2006-02-20 17:32 UTC (permalink / raw)
To: gdb-patches
On Wed, Mar 09, 2005 at 12:35:57PM -0500, 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've committed this patch from last year. As described above, I may be
back to make GDB pass the special symbols to an architecture hook to
handle things like mapping ARM vs Thumb code, if that becomes
necessary. For now, this is enough to make the ARM debugger much more
useful.
--
Daniel Jacobowitz
CodeSourcery
2006-02-20 Daniel Jacobowitz <dan@codesourcery.com>
* elfread.c (elf_symtab_read): Skip symbols which BFD considers
special.
Index: elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.54
diff -u -p -r1.54 elfread.c
--- elfread.c 27 Dec 2005 04:09:40 -0000 1.54
+++ elfread.c 20 Feb 2006 17:30:40 -0000
@@ -1,7 +1,7 @@
/* Read ELF (Executable and Linking Format) object files for GDB.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
@@ -174,6 +174,12 @@ elf_symtab_read (struct objfile *objfile
continue;
}
+ /* Skip "special" symbols, e.g. ARM mapping symbols. These are
+ symbols which do not correspond to objects in the symbol table,
+ but have some other target-specific meaning. */
+ if (bfd_is_target_special_symbol (objfile->obfd, sym))
+ continue;
+
offset = ANOFFSET (objfile->section_offsets, sym->section->index);
if (dynamic
&& sym->section == &bfd_und_section
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-20 17:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-09 17:36 [rfa] Skip "special" symbols when reading minimal symbols Daniel Jacobowitz
2005-03-11 0:10 ` Michael Snyder
2005-03-25 20:51 ` Daniel Jacobowitz
2006-02-20 17:32 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox