aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1994-04-21 17:09:31 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1994-04-21 17:09:31 +0000
commit0683ac4b2c2e533bd91cb345ac7b4215d41ec323 (patch)
tree3f9cbaf7cf338d0d608f640d90e820925b2a9178 /gdb/dbxread.c
parentcb71adf12b02561228bafbb2497baafaa930e6b9 (diff)
downloadfsf-binutils-gdb-0683ac4b2c2e533bd91cb345ac7b4215d41ec323.zip
fsf-binutils-gdb-0683ac4b2c2e533bd91cb345ac7b4215d41ec323.tar.gz
fsf-binutils-gdb-0683ac4b2c2e533bd91cb345ac7b4215d41ec323.tar.bz2
* dbxread.c (read_dbx_dynamic_symtab): Reinstall support for sun3,
BFD handles sun3 dynamic relocations now. * elfread.c (elf_symtab_read, elf_symfile_read): Handle dynamic symbol table.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 512fa87..5aa7312 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -890,13 +890,11 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
asection *sec;
int type;
- sym = *symptr;
- sym_value = sym->value;
-
sec = bfd_get_section (sym);
/* BFD symbols are section relative. */
- sym_value += sec->vma;
+ sym_value = sym->value + sec->vma;
+
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
{
sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
@@ -923,15 +921,6 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
}
}
- /* FIXME: Reading the dynamic relocs currently causes a bfd_assertion
- for sun3 executables. Do not read dynamic relocs till BFD is prepared
- to handle them. */
- if (bfd_get_arch (abfd) != bfd_arch_sparc)
- {
- do_cleanups (back_to);
- return;
- }
-
/* Symbols from shared libraries have a dynamic relocation entry
that points to the associated slot in the procedure linkage table.
We make a mininal symbol table entry with type mst_solib_trampoline
@@ -957,16 +946,30 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
counter < dynrel_count;
counter++, relptr++)
{
- arelent *rel;
+ arelent *rel = *relptr;
+ CORE_ADDR address = rel->address;
- /* FIXME: This probably doesn't work on a Sun3. */
+ switch (bfd_get_arch (abfd))
+ {
+ case bfd_arch_sparc:
+ if (rel->howto->type != RELOC_JMP_SLOT)
+ continue;
+ break;
+ case bfd_arch_m68k:
+ /* `16' is the type BFD produces for a jump table relocation. */
+ if (rel->howto->type != 16)
+ continue;
- rel = *relptr;
- if (rel->howto->type != RELOC_JMP_SLOT)
- continue;
+ /* Adjust address in the jump table to point to
+ the start of the bsr instruction. */
+ address -= 2;
+ break;
+ default:
+ continue;
+ }
prim_record_minimal_symbol (bfd_asymbol_name (*rel->sym_ptr_ptr),
- rel->address,
+ address,
mst_solib_trampoline,
objfile);
}