]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2009-06-25 Kai Tietz <kai.tietz@onevision.com>
authorKai Tietz <kai.tietz@onevision.com>
Thu, 25 Jun 2009 13:39:27 +0000 (13:39 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Thu, 25 Jun 2009 13:39:27 +0000 (13:39 +0000)
        * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
        give .debug and .reloc data characteristics.
        (DOT_RELOC): New define for .reloc section string.
        (coff_write_object_contents): Use DOT_RELOC instead of string.

bfd/ChangeLog
bfd/coffcode.h

index 5a27b6406db27e2d608bb03922255a4c45091b93..3ae57bc3fed89582e5849ef4af70a4dd514b93ce 100644 (file)
@@ -1,3 +1,10 @@
+2009-06-25  Kai Tietz  <kai.tietz@onevision.com>
+
+       * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
+       give .debug and .reloc data characteristics.
+       (DOT_RELOC): New define for .reloc section string.
+       (coff_write_object_contents): Use DOT_RELOC instead of string.
+
 2009-06-25  Tristan Gingold  <gingold@adacore.com>
 
        * mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound)
index 6a8a8cbcbcbfad52bf0ea7b5e900817c9ca9b1b7..d66d98aa89398058097c30638b878e4ae52ce70c 100644 (file)
@@ -371,6 +371,7 @@ CODE_FRAGMENT
 
 #define DOT_DEBUG      ".debug"
 #define GNU_LINKONCE_WI ".gnu.linkonce.wi."
+#define DOT_RELOC      ".reloc"
 
 #if defined (COFF_LONG_SECTION_NAMES)
 /* Needed to expand the inputs to BLANKOR1TOODD.  */
@@ -645,7 +646,12 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
   /* FIXME: There is no gas syntax to specify the debug section flag.  */
   if (CONST_STRNEQ (sec_name, DOT_DEBUG)
       || CONST_STRNEQ (sec_name, GNU_LINKONCE_WI))
-    sec_flags = SEC_DEBUGGING | SEC_READONLY;
+    sec_flags = SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_DEBUGGING | SEC_READONLY;
+  else if (CONST_STRNEQ (sec_name, DOT_RELOC))
+    {
+      sec_flags = SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
+      styp_flags |= IMAGE_SCN_MEM_DISCARDABLE;
+    }
 
   /* skip LOAD */
   /* READONLY later */
@@ -3625,7 +3631,7 @@ coff_write_object_contents (bfd * abfd)
       bfd_boolean is_reloc_section = FALSE;
 
 #ifdef COFF_IMAGE_WITH_PE
-      if (strcmp (current->name, ".reloc") == 0)
+      if (strcmp (current->name, DOT_RELOC) == 0)
        {
          is_reloc_section = TRUE;
          hasrelocs = TRUE;