aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>2000-11-03 19:00:06 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>2000-11-03 19:00:06 +0000
commit36b0c0e0219069b331db088e9cf7f5b2797e9293 (patch)
tree382b956a440e859d0b45209a07353a3cc75b1ecd /gdb/objfiles.c
parentade0b24fe1ed4c384adb12fff3b1bcf2d7a29454 (diff)
downloadgdb-36b0c0e0219069b331db088e9cf7f5b2797e9293.zip
gdb-36b0c0e0219069b331db088e9cf7f5b2797e9293.tar.gz
gdb-36b0c0e0219069b331db088e9cf7f5b2797e9293.tar.bz2
* objfiles.c (objfile_relocate): Relocate ei.entry_point with
its section offset, use SECT_OFF_TEXT only as a fallback.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 60c8c6e..19e95b5 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));