aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2004-02-21 06:16:02 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2004-02-21 06:16:02 +0000
commit3c9d0484ea76c668eeaa5655e46bfafe05b82133 (patch)
tree6d0278f94506c106925e3998e23d888afd7e7076 /bfd/peXXigen.c
parentf6fe98efdcadbe85913d89d0d67f6f9d81becb50 (diff)
downloadgdb-3c9d0484ea76c668eeaa5655e46bfafe05b82133.zip
gdb-3c9d0484ea76c668eeaa5655e46bfafe05b82133.tar.gz
gdb-3c9d0484ea76c668eeaa5655e46bfafe05b82133.tar.bz2
* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
IMAGE_SCN_MEM_WRITE on known sections only.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 559f2a2..598aa7c 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -992,14 +992,13 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out)
default WP_TEXT file flag has been cleared. WP_TEXT may be cleared
by ld --enable-auto-import (if auto-import is actually needed),
by ld --omagic, or by obcopy --writable-text. */
-
- if (strcmp (scnhdr_int->s_name, ".text")
- || (bfd_get_file_flags (abfd) & WP_TEXT))
- flags &= ~IMAGE_SCN_MEM_WRITE;
for (p = known_sections; p->section_name; p++)
if (strcmp (scnhdr_int->s_name, p->section_name) == 0)
{
+ if (strcmp (scnhdr_int->s_name, ".text")
+ || (bfd_get_file_flags (abfd) & WP_TEXT))
+ flags &= ~IMAGE_SCN_MEM_WRITE;
flags |= p->must_have;
break;
}