summaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-06-14 18:08:47 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-06-14 18:08:47 +0000
commit230bac55c0bfe6bf4aeaffc03b8995570c39d35c (patch)
tree5e5477c70dc79b6182aa43e88cb7840ce81cc41c /gdb/exec.c
parent57db482b8ea3919ee06ac7a11b1c76320c5807ff (diff)
downloadgdb-230bac55c0bfe6bf4aeaffc03b8995570c39d35c.tar.gz
import gdb-1999-06-14 snapshot
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 600a905c8ba..d24c4b49bff 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -641,6 +641,44 @@ exec_files_info (t)
}
}
+/* msnyder 5/21/99:
+ exec_set_section_offsets sets the offsets of all the sections
+ in the exec objfile. */
+
+void
+exec_set_section_offsets (text_off, data_off, bss_off)
+ bfd_signed_vma text_off;
+ bfd_signed_vma data_off;
+ bfd_signed_vma bss_off;
+{
+ struct section_table *sect;
+
+ for (sect = exec_ops.to_sections;
+ sect < exec_ops.to_sections_end;
+ sect++)
+ {
+ flagword flags;
+
+ flags = bfd_get_section_flags (exec_bfd, sect->the_bfd_section);
+
+ if (flags & SEC_CODE)
+ {
+ sect->addr += text_off;
+ sect->endaddr += text_off;
+ }
+ else if (flags & (SEC_DATA | SEC_LOAD))
+ {
+ sect->addr += data_off;
+ sect->endaddr += data_off;
+ }
+ else if (flags & SEC_ALLOC)
+ {
+ sect->addr += bss_off;
+ sect->endaddr += bss_off;
+ }
+ }
+}
+
static void
set_section_command (args, from_tty)
char *args;