This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] xcoffread.c: handle -bbigtoc binaries
- To: gdb-patches at sources dot redhat dot com
- Subject: [RFA] xcoffread.c: handle -bbigtoc binaries
- From: Nicholas Duffek <nsd at redhat dot com>
- Date: Thu, 12 Apr 2001 14:57:09 -0400
- CC: Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de, kevinb at cygnus dot com
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;