* Makefile.in (objfiles.o): Update.
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index 38768ccedb66386e8e4f5581191a47a3456e73a1..2b30b6c432ae6921a627d1b699154de434e349ed 100644 (file)
@@ -49,6 +49,7 @@
 #include "source.h"
 #include "addrmap.h"
 #include "arch-utils.h"
+#include "exec.h"
 
 /* Prototypes for local functions */
 
@@ -532,6 +533,7 @@ free_all_objfiles (void)
 void
 objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
 {
+  struct obj_section *s;
   struct section_offsets *delta =
     ((struct section_offsets *) 
      alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)));
@@ -683,6 +685,15 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
       }
   }
 
+  /* Update the table in exec_ops, used to read memory.  */
+  ALL_OBJFILE_OSECTIONS (objfile, s)
+    {
+      int idx = s->the_bfd_section->index;
+
+      exec_set_section_address (bfd_get_filename (objfile->obfd), idx,
+                               s->addr);
+    }
+
   /* Relocate breakpoints as necessary, after things are relocated. */
   breakpoint_re_set ();
 }
This page took 0.033295 seconds and 4 git commands to generate.