Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nicholas Duffek <nsd@redhat.com>
To: gdb-patches@sources.redhat.com
Cc: Peter.Schauer@regent.e-technik.tu-muenchen.de, kevinb@cygnus.com
Subject: [RFA] xcoffread.c: handle -bbigtoc binaries
Date: Thu, 12 Apr 2001 12:02:00 -0000	[thread overview]
Message-ID: <200104121857.OAA27215@nog.bosbc.com> (raw)

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;
 


             reply	other threads:[~2001-04-12 12:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-12 12:02 Nicholas Duffek [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200104121857.OAA27215@nog.bosbc.com \
    --to=nsd@redhat.com \
    --cc=Peter.Schauer@regent.e-technik.tu-muenchen.de \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox