Do not mark .reloc sections as containing debug info.
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index ccac05bcaec0bf614f28d386e6b90134ce67cdb2..15d97093f67b0132cd29ddbd21994fb581d3b951 100644 (file)
@@ -1064,7 +1064,11 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
          sec_flags &= ~ SEC_READONLY;
          break;
        case IMAGE_SCN_MEM_DISCARDABLE:
-         sec_flags |= SEC_DEBUGGING;
+         /* The MS PE spec sets the DISCARDABLE flag on .reloc sections
+            but we do not want them to be labelled as debug section, since
+            then strip would remove them.  */
+         if (strncmp (name, ".reloc", sizeof ".reloc" - 1) != 0)
+           sec_flags |= SEC_DEBUGGING;
          break;
        case IMAGE_SCN_MEM_SHARED:
          sec_flags |= SEC_SHARED;
This page took 0.023433 seconds and 4 git commands to generate.