diff options
author | Pedro Alves <palves@redhat.com> | 2009-08-17 11:16:13 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2009-08-17 11:16:13 +0000 |
commit | f1f2b5f40ef91b70acaa733f6f92f08de5efa29f (patch) | |
tree | 398dff7db313fd1e923f87797f5a78beac52ee40 /gdb/objfiles.c | |
parent | ed4e4aa28d1d647a2f20971db49c975121156e2d (diff) | |
download | gdb-f1f2b5f40ef91b70acaa733f6f92f08de5efa29f.zip gdb-f1f2b5f40ef91b70acaa733f6f92f08de5efa29f.tar.gz gdb-f1f2b5f40ef91b70acaa733f6f92f08de5efa29f.tar.bz2 |
2009-08-17 Pedro Alves <pedro@codesourcery.com>>
* objfiles.c (objfile_relocate): Relocate the entry point before
relocating the section offsets. Flush the section map before
resetting breakpoints.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 586f5d0..92db65e 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -666,12 +666,6 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) to be out of order. */ msymbols_sort (objfile); - { - int i; - for (i = 0; i < objfile->num_sections; ++i) - (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 @@ -684,6 +678,15 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); } + { + int i; + for (i = 0; i < objfile->num_sections; ++i) + (objfile->section_offsets)->offsets[i] = ANOFFSET (new_offsets, i); + } + + /* Rebuild section map next time we need it. */ + objfiles_changed_p = 1; + /* Update the table in exec_ops, used to read memory. */ ALL_OBJFILE_OSECTIONS (objfile, s) { @@ -695,7 +698,6 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) /* Relocate breakpoints as necessary, after things are relocated. */ breakpoint_re_set (); - objfiles_changed_p = 1; /* Rebuild section map next time we need it. */ } /* Many places in gdb want to test just to see if we have any partial |