2002-01-31 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 1 Feb 2002 00:49:53 +0000 (00:49 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 1 Feb 2002 00:49:53 +0000 (00:49 +0000)
* target.c (do_xfer_memory): Add missing line to trust-readonly
code: check bfd SEC_READONLY flag for section.

gdb/ChangeLog
gdb/target.c

index 4c86a734d2e8bdc5f65a65ef7239dc20b0067aa1..1f5e6b3707842e5567e955f5ab556e2075f1c79e 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-31  Michael Snyder  <msnyder@redhat.com>
+
+       * target.c (do_xfer_memory): Add missing line to trust-readonly
+       code: check bfd SEC_READONLY flag for section.
+
 2002-01-31  Andrew Cagney  <ac131313@redhat.com>
 
        * PROBLEMS: Fix tipo, 5.1->5.1.1.
index 95ec4ef650a43f1d00a7ada3a60d54caf642b346..529291f879c60ba2204474e5c79ec2f27a9ec24b 100644 (file)
@@ -871,9 +871,11 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
           secp < current_target.to_sections_end;
           secp++)
        {
-         if (memaddr >= secp->addr && memaddr < secp->endaddr)
-           return xfer_memory (memaddr, myaddr, len, 0, 
-                               attrib, &current_target);
+         if (bfd_get_section_flags (secp->bfd, secp->the_bfd_section) 
+             & SEC_READONLY)
+           if (memaddr >= secp->addr && memaddr < secp->endaddr)
+             return xfer_memory (memaddr, myaddr, len, 0, 
+                                 attrib, &current_target);
        }
     }