diff options
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 6c6dfc2..4f0dfd6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -450,7 +450,7 @@ objfile_relocate (objfile, new_offsets) { struct symtab *s; - for (s = objfile->symtabs; s; s = s->next) + ALL_OBJFILE_SYMTABS (objfile, s) { struct linetable *l; struct blockvector *bv; @@ -492,6 +492,15 @@ objfile_relocate (objfile, new_offsets) SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (delta, SYMBOL_SECTION (sym)); } +#ifdef MIPS_EFI_SYMBOL_NAME + /* Relocate Extra Function Info for ecoff. */ + + else + if (SYMBOL_CLASS (sym) == LOC_CONST + && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE + && STRCMP (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0) + ecoff_relocate_efi (sym, ANOFFSET (delta, s->block_line_section)); +#endif } } } @@ -538,6 +547,37 @@ objfile_relocate (objfile, new_offsets) for (i = 0; i < objfile->num_sections; ++i) ANOFFSET (objfile->section_offsets, i) = ANOFFSET (new_offsets, i); } + + { + struct obj_section *s; + bfd *abfd; + + abfd = symfile_objfile->obfd; + + for (s = symfile_objfile->sections; + s < symfile_objfile->sections_end; ++s) + { + flagword flags; + + flags = bfd_get_section_flags (abfd, s->the_bfd_section); + + if (flags & SEC_CODE) + { + s->addr += ANOFFSET (delta, SECT_OFF_TEXT); + s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT); + } + else if (flags & (SEC_DATA | SEC_LOAD)) + { + s->addr += ANOFFSET (delta, SECT_OFF_DATA); + s->endaddr += ANOFFSET (delta, SECT_OFF_DATA); + } + else if (flags & SEC_ALLOC) + { + s->addr += ANOFFSET (delta, SECT_OFF_BSS); + s->endaddr += ANOFFSET (delta, SECT_OFF_BSS); + } + } + } } /* Many places in gdb want to test just to see if we have any partial |