aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-03-26 14:59:43 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-03-26 14:59:43 +0000
commit3c02636b4ef8b4526865bf3a9baeba2011ff0d08 (patch)
tree5424aa520ee09da58c7601202b89865e7fa903c4 /gdb/buildsym.c
parent786f2f340287e170737a96aea29b5d45d5d28957 (diff)
downloadgdb-3c02636b4ef8b4526865bf3a9baeba2011ff0d08.zip
gdb-3c02636b4ef8b4526865bf3a9baeba2011ff0d08.tar.gz
gdb-3c02636b4ef8b4526865bf3a9baeba2011ff0d08.tar.bz2
* Clean up xcoff relocation.
objfiles.h (struct objfiles): Add section_offsets, num_sections. symfile.c (syms_from_objfile), xcoffread.c (xcoff_symfile_offsets): Set them. symtab.h (struct general_symbol_info): Add section field. minsyms.c (prim_record_minimal_symbol{,_and_info}): Set it. xcoffread.c: Set section for symbols and msymbols. (struct symtab): Add block_line_section field. buildsym.c (end_symtab): Set it. (end_symtab and callers): Add section parameter. objfiles.c (objfile_relocate): New funciton. xcoffexec.c (vmap_symtab): Use it. xcoffsolib.h (struct vmap): Remove unused fields. config/rs6000/tm-rs6000.h, stack.c, xcoffexec.c: Remove CORE_NEEDS_RELOCATION, symtab_relocated. config/rs6000/tm-rs6000.h: Remove use of loadinfotext. rs6000-tdep.c: Make loadinfotext static. breakpoint.c (fixup_breakpoints): Doc fix. symtab.h (struct symtab), config/rs6000/tm-rs6000.h, buildsym.c (end_symtab): primary field replaces nonreloc.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 21020be..6c8c807 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -588,6 +588,8 @@ start_symtab (name, dirname, start_addr)
for that file and put it in the list of all such.
END_ADDR is the address of the end of the file's text.
+ SECTION is the section number (in objfile->section_offsets) of
+ the blockvector and linetable.
Note that it is possible for end_symtab() to return NULL. In particular,
for the DWARF case at least, it will return NULL when it finds a
@@ -597,11 +599,12 @@ start_symtab (name, dirname, start_addr)
because then gdb will never know about this empty file (FIXME). */
struct symtab *
-end_symtab (end_addr, sort_pending, sort_linevec, objfile)
+end_symtab (end_addr, sort_pending, sort_linevec, objfile, section)
CORE_ADDR end_addr;
int sort_pending;
int sort_linevec;
struct objfile *objfile;
+ int section;
{
register struct symtab *symtab;
register struct blockvector *blockvector;
@@ -731,6 +734,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
{
symtab->linetable = NULL;
}
+ symtab->block_line_section = section;
if (subfile->dirname)
{
/* Reallocate the dirname on the symbol obstack */
@@ -753,14 +757,11 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
language it is from things we found in the symbols. */
symtab->language = subfile->language;
-#ifdef IBM6000_TARGET
- /* In case we need to duplicate symbol tables (to represent include
- files), and in case our system needs relocation, we want to
- relocate the main symbol table node only (for the main file,
- not for the include files). */
+ /* All symtabs for the main file and the subfiles share a
+ blockvector, so we need to clear primary for everything but
+ the main file. */
- symtab->nonreloc = TRUE;
-#endif
+ symtab->primary = 0;
}
if (subfile->name != NULL)
{
@@ -779,14 +780,11 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
free ((PTR)subfile);
}
-#ifdef IBM6000_TARGET
- /* all include symbol tables are non-relocatable, except the main source
- file's. */
+ /* Set this for the main source file. */
if (symtab)
{
- symtab->nonreloc = FALSE;
+ symtab->primary = 1;
}
-#endif
last_source_file = NULL;
current_subfile = NULL;