diff options
author | Peter Schauer <pes@regent.e-technik.tu-muenchen.de> | 2000-11-03 19:00:06 +0000 |
---|---|---|
committer | Peter Schauer <pes@regent.e-technik.tu-muenchen.de> | 2000-11-03 19:00:06 +0000 |
commit | 8e74fe3dc639f9e85e471ac2009b87507c9fdbc3 (patch) | |
tree | ea3c661c0a28f294a1eac449eab4d9c7749bd611 | |
parent | 453d0a656edb68befdd8fa8d29af5040d2cc8903 (diff) | |
download | gdb-8e74fe3dc639f9e85e471ac2009b87507c9fdbc3.tar.gz |
* objfiles.c (objfile_relocate): Relocate ei.entry_point with
its section offset, use SECT_OFF_TEXT only as a fallback.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/objfiles.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 95d9d652ee3..ca5db2f19b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2000-11-03 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> + + * objfiles.c (objfile_relocate): Relocate ei.entry_point with + its section offset, use SECT_OFF_TEXT only as a fallback. + 2000-11-01 Kevin Buettner <kevinb@redhat.com> * symm-nat.c (print_1167_regs): Remove extraneous blank line diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 60c8c6e680e..19e95b573a3 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -642,6 +642,18 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) (objfile->section_offsets)->offsets[i] = ANOFFSET (new_offsets, i); } + if (objfile->ei.entry_point != ~(CORE_ADDR) 0) + { + /* Relocate ei.entry_point with its section offset, use SECT_OFF_TEXT + only as a fallback. */ + struct obj_section *s; + s = find_pc_section (objfile->ei.entry_point); + if (s) + objfile->ei.entry_point += ANOFFSET (delta, s->the_bfd_section->index); + else + objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); + } + { struct obj_section *s; bfd *abfd; @@ -657,9 +669,6 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) } } - if (objfile->ei.entry_point != ~(CORE_ADDR) 0) - objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC) { objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); |