aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1995-02-09 07:00:45 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1995-02-09 07:00:45 +0000
commit2d336b1b5186660c5965deb7b7728fefe0f2d14d (patch)
tree63738f35d4b8fd6e25a72ef0bcb0c7aa9a0cc203 /gdb/elfread.c
parent151e7820c7460be261142e031fe35a7a193f8acd (diff)
downloadgdb-2d336b1b5186660c5965deb7b7728fefe0f2d14d.zip
gdb-2d336b1b5186660c5965deb7b7728fefe0f2d14d.tar.gz
gdb-2d336b1b5186660c5965deb7b7728fefe0f2d14d.tar.bz2
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING. * symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add filename field. * elfread.c (record_minimal_symbol_and_info), minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return newly created symbol. * elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]: Set filename field of minimal symbol. * symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]: Print filename field. * minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile. * symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y, m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c, os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c, printcmd.c, dbxread.c: Change callers to pass NULL for sfile. * dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Find address of function from minimal symbols. * partial-stab.h, case 'f', 'F': Call find_stab_function_addr instead of getting pst->textlow from the stab. * minsyms.c (find_stab_function_addr): New function.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 0b16463..326f93c 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -81,7 +81,7 @@ free_elfinfo PARAMS ((void *));
static struct section_offsets *
elf_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
-static void
+static struct minimal_symbol *
record_minimal_symbol_and_info PARAMS ((char *, CORE_ADDR,
enum minimal_symbol_type, char *,
struct objfile *));
@@ -171,7 +171,7 @@ elf_interpreter (abfd)
#endif
-static void
+static struct minimal_symbol *
record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
char *name;
CORE_ADDR address;
@@ -206,8 +206,8 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
}
name = obsavestring (name, strlen (name), &objfile -> symbol_obstack);
- prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
- objfile);
+ return prim_record_minimal_symbol_and_info
+ (name, address, ms_type, info, section, objfile);
}
/*
@@ -258,6 +258,10 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
/* If filesym is nonzero, it points to a file symbol, but we haven't
seen any section info for it yet. */
asymbol *filesym = 0;
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+ /* Name of filesym, as saved on the symbol_obstack. */
+ char *filesymname;
+#endif
struct dbx_symfile_info *dbx = (struct dbx_symfile_info *)
objfile->sym_stab_info;
unsigned long size;
@@ -340,9 +344,16 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
sectinfo = NULL;
}
filesym = sym;
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+ filesymname =
+ obsavestring ((char *)filesym->name, strlen (filesym->name),
+ &objfile->symbol_obstack);
+#endif
}
else if (sym -> flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
{
+ struct minimal_symbol *msym;
+
/* Select global/local/weak symbols. Note that bfd puts abs
symbols in their own section, so all symbols we are
interested in will have a section. */
@@ -498,8 +509,12 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
/* Pass symbol size field in via BFD. FIXME!!! */
size = ((elf_symbol_type *) sym) -> internal_elf_sym.st_size;
- record_minimal_symbol_and_info ((char *) sym -> name, symaddr,
- ms_type, (PTR) size, objfile);
+ msym = record_minimal_symbol_and_info
+ ((char *) sym -> name, symaddr,
+ ms_type, (PTR) size, objfile);
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+ msym->filename = filesymname;
+#endif
}
}
do_cleanups (back_to);