From 30510692eb858ac9c7262a187d78337a7503d196 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sat, 3 May 2008 18:04:02 +0000 Subject: * Makefile.in (objfiles.o): Update. * exec.c (exec_set_section_address): Support p->addr != 0. * objfiles.c (objfile_relocate): Update exec_ops section addresses. * symfile.c (place_section): Move exec_set_section_address call... (default_symfile_offsets): ...to here. --- gdb/objfiles.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gdb/objfiles.c') diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 38768cc..2b30b6c 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -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 (); } -- cgit v1.1