This is the mail archive of the gdb-patches@sourceware.org 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: Fix warning on AIX about missing symbols in symtab with bigtoc


[Kevin B: I apologize if you responded already to my last mail.  It occurred 
to me that I might have lost your reply to the zealotry of my spam filter.]

On AIX, we've been seeing messages

  'pc 0xnnnnnnnnn in read in psymtab, but not in symtab.'

that arise with largish programs that require the -bbigtoc linker option and
are compiled with -g.  What appears to happen in such cases is that something
in the gcc tool chain generates @FIXn csect symbols, which trigger creation
of a psymtab) and @FIXn:F-11 C_FUN symbols, which get added to that psymtab 
as the only global symbol, and thus prevents the psymtab from begin removed
(as empty psymtabs are).  Now the @FIXn:F-11 symbol apparently gets entered 
in the symbol table if its entry is followed by a .bf C_FCN symbol (if
I read the logic of read_xcoff_symtab aright), and for these particular 
symbols, that does not happen: hence the eventual message.  

It seems to me that this might be a compiler issue, and specfically that 
the @FIXn:F-11 symbols ought not to be generated.  If someone confirms 
this, I'll turn this into a GCC report.  If this is NOT a compiler problem,
we at Adacore are currently using the following patch.  Comment or approval
appreciated.

Paul Hilfinger

Changelog:

2008-08-09  Paul N. Hilfinger  <hilfingr@adacore.com>

	* xcoffread.c (scan_xcoff_symtab): Do not include global symbols
	('F' format) for @FIX names generated by the loader, retaining only
	the minimal symbols (and no partial symbol tables) for these names.
	Fixes warning messages about symbols that are found in partial 
	symbol tables, but not full symbol tables.


Index: gdb/xcoffread.c
===================================================================
RCS file: /cvs/src/src/gdb/xcoffread.c,v
retrieving revision 1.60
diff -u -p -r1.60 xcoffread.c
--- gdb/xcoffread.c	27 Mar 2008 12:28:48 -0000	1.60
+++ gdb/xcoffread.c	9 Aug 2008 22:31:09 -0000
@@ -2755,6 +2755,14 @@ scan_xcoff_symtab (struct objfile *objfi
 		    function_outside_compilation_unit_complaint (name);
 		    xfree (name);
 		  }
+
+		/* We need only the minimal symbols for these
+		   loader-generated definitions.   Keeping the global
+		   symbols leads to "in psymbols but not in symbols"
+		   errors. */
+		if (strncmp (namestring, "@FIX", 4) == 0)
+		  continue;
+
 		symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 		add_psymbol_to_list (namestring, p - namestring,
 				     VAR_DOMAIN, LOC_BLOCK,


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