aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-09-13 01:47:16 +0000
committerKevin Buettner <kevinb@redhat.com>2000-09-13 01:47:16 +0000
commit78f0949be7cc59219063bf349b1d260807a6a254 (patch)
tree96a82e96741440e086cde42cb8a9134861fa6719 /gdb
parentdcd619bedd024cbf98ee895bfb15a195bfa0c852 (diff)
downloadgdb-78f0949be7cc59219063bf349b1d260807a6a254.zip
gdb-78f0949be7cc59219063bf349b1d260807a6a254.tar.gz
gdb-78f0949be7cc59219063bf349b1d260807a6a254.tar.bz2
In objfile_relocate(), don't assume that offsets associated with one
of SECT_OFF_TEXT, SECT_OFF_DATA, or SECT_OFF_BSS will be adequate for relocating all of the sections in an objfile.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/objfiles.c23
2 files changed, 11 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c89ace0..4085e75 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-12 Kevin Buettner <kevinb@redhat.com>
+
+ * objfiles.c (objfile_relocate): Don't assume that offsets
+ associated with one of SECT_OFF_TEXT, SECT_OFF_DATA, or
+ SECT_OFF_BSS will be adequate for relocating all of the
+ sections in an objfile.
+
2000-09-12 Fernando Nasser <fnasser@cygnus.com>
* remote-rdi.c (arm_rdi_open): Fix typo in error message.
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index e0228f5..60c8c6e 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -650,25 +650,10 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
ALL_OBJFILE_OSECTIONS (objfile, s)
{
- flagword flags;
-
- flags = bfd_get_section_flags (abfd, s->the_bfd_section);
-
- if (flags & SEC_CODE)
- {
- s->addr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
- s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
- }
- else if (flags & (SEC_DATA | SEC_LOAD))
- {
- s->addr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
- s->endaddr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
- }
- else if (flags & SEC_ALLOC)
- {
- s->addr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
- s->endaddr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
- }
+ int idx = s->the_bfd_section->index;
+
+ s->addr += ANOFFSET (delta, idx);
+ s->endaddr += ANOFFSET (delta, idx);
}
}