* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
authorDanny Smith <dannysmith@users.sourceforge.net>
Sat, 21 Feb 2004 06:16:02 +0000 (06:16 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Sat, 21 Feb 2004 06:16:02 +0000 (06:16 +0000)
IMAGE_SCN_MEM_WRITE on known sections only.

bfd/ChangeLog
bfd/peXXigen.c

index 6ce3246583392fe433d51a6bd54f418c53679a61..4c97561dd33b8ce8a54ae4a96a3bbef72d073c7c 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
+
+       * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
+       IMAGE_SCN_MEM_WRITE on known sections only.
+
 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
 
        * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
index 559f2a2f67b50c8e3f71c1a91021aeb1f3a15556..598aa7cfa03b8e1e4df0add3319f045518110dbf 100644 (file)
@@ -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;
        }