summaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-31 06:52:33 -0700
committerTom Tromey <tromey@redhat.com>2014-01-15 11:02:23 -0700
commit53eddfa6069cc556a22d388fbde0cc83beb91bfb (patch)
tree86c4d38a4e0d7370216b90cb711471d1ce45ce7b /gdb/objfiles.c
parentd56e56aaa79d7d65e9d969a7bf6795f2612d34ca (diff)
relocate the entry point address when used
This changes the entry point to be unrelocated in the objfile, and instead applies the relocation when it is used. 2014-01-15 Tom Tromey <tromey@redhat.com> * objfiles.c (entry_point_address_query): Relocate entry point address. (objfile_relocate1): Do not relocate entry point address. * objfiles.h (struct entry_info) <entry_point>: Update comment. <the_bfd_section_index>: New field. * symfile.c (init_entry_point_info): Find the entry point's section.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 9cc0054557..a80d4c729c 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -367,7 +367,9 @@ entry_point_address_query (CORE_ADDR *entry_p)
if (symfile_objfile == NULL || !symfile_objfile->ei.entry_point_p)
return 0;
- *entry_p = symfile_objfile->ei.entry_point;
+ *entry_p = (symfile_objfile->ei.entry_point
+ + ANOFFSET (symfile_objfile->section_offsets,
+ symfile_objfile->ei.the_bfd_section_index));
return 1;
}
@@ -794,22 +796,6 @@ objfile_relocate1 (struct objfile *objfile,
to be out of order. */
msymbols_sort (objfile);
- if (objfile->ei.entry_point_p)
- {
- /* 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)
- {
- int idx = gdb_bfd_section_index (objfile->obfd, s->the_bfd_section);
-
- objfile->ei.entry_point += ANOFFSET (delta, idx);
- }
- else
- objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
- }
-
{
int i;