summaryrefslogtreecommitdiffstats
path: root/gdb
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1992-05-09 21:49:28 +0000
committerStu Grossman <grossman@cygnus>1992-05-09 21:49:28 +0000
commit1e939db1573f1c1c81b7bd659783dfd8754022bd (patch)
tree6dc38d7069e7147783ac36ec271ba4aa9344ab78 /gdb
parentcb467682ed27de139f5a3945ca2ec28e6d05a819 (diff)
downloadppe42-binutils-1e939db1573f1c1c81b7bd659783dfd8754022bd.tar.gz
ppe42-binutils-1e939db1573f1c1c81b7bd659783dfd8754022bd.zip
* xcoffexec.c (vmap_exec): Don't assume .text and .data are the
first two sections.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/xcoffexec.c29
2 files changed, 22 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2a1ba6de87..889d3d5b4d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+Sat May 9 14:47:28 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xcoffexec.c (vmap_exec): Don't assume .text and .data are the
+ first two sections.
+
Fri May 8 11:42:15 1992 Per Bothner (bothner@rtl.cygnus.com)
* mipsread.c (parse_procedure): Return rather than using
diff --git a/gdb/xcoffexec.c b/gdb/xcoffexec.c
index 8e4322fe80..ce8040a54a 100644
--- a/gdb/xcoffexec.c
+++ b/gdb/xcoffexec.c
@@ -629,24 +629,29 @@ register struct ld_info *ldi; {
vmap_exec ()
{
static bfd *execbfd;
+ int i;
+
if (execbfd == exec_bfd)
return;
execbfd = exec_bfd;
- /* First exec section is `.text', second is `.data'. If this is changed,
- then this routine will choke. */
-
- if (!vmap || !exec_ops.to_sections ||
- strcmp (exec_ops.to_sections[0].sec_ptr->name, ".text") ||
- strcmp (exec_ops.to_sections[1].sec_ptr->name, ".data"))
+ if (!vmap || !exec_ops.to_sections)
+ error ("vmap_exec: vmap or exec_ops.to_sections == 0\n");
- fatal ("aix: Improper exec_ops sections.");
-
- exec_ops.to_sections [0].addr += vmap->tstart;
- exec_ops.to_sections [0].endaddr += vmap->tstart;
- exec_ops.to_sections [1].addr += vmap->dstart;
- exec_ops.to_sections [1].endaddr += vmap->dstart;
+ for (i=0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
+ {
+ if (strcmp(".text", exec_ops.to_sections[i].sec_ptr->name) == 0)
+ {
+ exec_ops.to_sections[i].addr += vmap->tstart;
+ exec_ops.to_sections[i].endaddr += vmap->tstart;
+ }
+ else if (strcmp(".data", exec_ops.to_sections[i].sec_ptr->name) == 0)
+ {
+ exec_ops.to_sections[i].addr += vmap->dstart;
+ exec_ops.to_sections[i].endaddr += vmap->dstart;
+ }
+ }
}
OpenPOWER on IntegriCloud