From 405f26e62fac15d3bb255ebe9dfe1fbff4950f2b Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 1 Feb 2002 00:49:53 +0000 Subject: [PATCH] 2002-01-31 Michael Snyder * target.c (do_xfer_memory): Add missing line to trust-readonly code: check bfd SEC_READONLY flag for section. --- gdb/ChangeLog | 5 +++++ gdb/target.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4c86a734d2e..1f5e6b37078 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-01-31 Michael Snyder + + * target.c (do_xfer_memory): Add missing line to trust-readonly + code: check bfd SEC_READONLY flag for section. + 2002-01-31 Andrew Cagney * PROBLEMS: Fix tipo, 5.1->5.1.1. diff --git a/gdb/target.c b/gdb/target.c index 95ec4ef650a..529291f879c 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -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, ¤t_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, ¤t_target); } } -- 2.30.2