Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] xcoffread.c: handle -bbigtoc binaries
@ 2001-04-12 12:02 Nicholas Duffek
  2001-04-12 12:23 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Duffek @ 2001-04-12 12:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Peter.Schauer, kevinb

This patch prevents "pc 0x... in read in psymtab, but not in symtab"
warnings when debugging binaries linked with -bbigtoc.

Explanation:

-bbigtoc binaries have extra sections named @FIX1 containing
linker-generated code to perform data loads from distant locations.  E.g.,
if 'foo' in the following instruction:

  lwz r9,foo(r2)

is greater than 32767, the linker might replace the lwz with a branch to
linker-generated code that does the load in 2 instructions and then
branches back to where execution should continue.

When xcoffread.c encounters such a section, it allocates a new psymtab for
the range of linker-generated instructions contained in the section.
However, the section doesn't associate those instructions with any
functions.  Consequently, when GDB tries to resolve one of those
instructions to a symbolic name, it fails, resulting in the "pc 0x... in
read in psymtab, but not in symtab" warning.

The appended patch avoids that warning by ignoring section names beginning
with '@'.

ChangeLog:

	* xcoffread.c (scan_xcoff_symtab): Ignore symbols beginning with
	"@".

Tested on powerpc-ibm-aix4.3.3.0.  Okay to apply?

Nicholas Duffek
<nsd@redhat.com>

[patch follows]

Index: gdb/xcoffread.c
===================================================================
diff -up gdb/xcoffread.c gdb/xcoffread.c
--- gdb/xcoffread.c	Thu Apr 12 14:39:21 2001
+++ gdb/xcoffread.c	Thu Apr 12 14:39:09 2001
@@ -2243,8 +2243,14 @@ scan_xcoff_symtab (struct objfile *objfi
 	    else
 	      csect_aux = main_aux[0];
 
-	    /* If symbol name starts with ".$" or "$", ignore it.  */
-	    if (namestring[0] == '$'
+	    /* If symbol name starts with ".$" or "$", ignore it. 
+
+	       A symbol like "@FIX1" introduces a section for -bbigtoc jump
+	       tables, which contain anonymous linker-generated code. 
+	       Ignore those sections to avoid "pc 0x... in read in psymtab,
+	       but not in symtab" warnings from find_pc_sect_symtab.  */
+
+	    if (namestring[0] == '$' || namestring[0] == '@'
 		|| (namestring[0] == '.' && namestring[1] == '$'))
 	      break;
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-04-12 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-12 12:02 [RFA] xcoffread.c: handle -bbigtoc binaries Nicholas Duffek
2001-04-12 12:23 ` Kevin Buettner
2001-04-12 12:55   ` Nick Duffek
2001-04-12 14:14     ` Andrew Cagney
2001-04-12 14:53       ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox