This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa] Skip "special" symbols when reading minimal symbols


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]