aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2009-01-16 15:09:20 +0000
committerKai Tietz <kai.tietz@onevision.com>2009-01-16 15:09:20 +0000
commitf6d29e26d6bf24dfcc42558390082aeb7ac034e5 (patch)
tree92d1e52fa3c89f575a2a688cc039f057389d99eb /bfd/coffcode.h
parent258795f524fca9d5b98441b81684c331c4d721b1 (diff)
downloadgdb-f6d29e26d6bf24dfcc42558390082aeb7ac034e5.zip
gdb-f6d29e26d6bf24dfcc42558390082aeb7ac034e5.tar.gz
gdb-f6d29e26d6bf24dfcc42558390082aeb7ac034e5.tar.bz2
2009-01-16 Kai Tietz <kai.tietz@onevision.com>
* coffcode.h (styp_to_sec_flags): Correct interpretation of IMAGE_SCN_MEM_DISCARDABLE.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 12d2ad5..db0b2e9 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1069,10 +1069,19 @@ styp_to_sec_flags (bfd *abfd,
sec_flags &= ~ SEC_READONLY;
break;
case IMAGE_SCN_MEM_DISCARDABLE:
- /* 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 (! CONST_STRNEQ (name, ".reloc"))
+ /* The MS PE spec says that debug sections are DISCARDABLE,
+ but the presence of a DISCARDABLE flag does not necessarily
+ mean that a given section contains debug information. Thus
+ we only set the SEC_DEBUGGING flag on sections that we
+ recognise as containing debug information. */
+ if (CONST_STRNEQ (name, DOT_DEBUG)
+#ifdef _COMMENT
+ || strcmp (name, _COMMENT) == 0
+#endif
+#ifdef COFF_LONG_SECTION_NAMES
+ || CONST_STRNEQ (name, GNU_LINKONCE_WI)
+#endif
+ || CONST_STRNEQ (name, ".stab"))
sec_flags |= SEC_DEBUGGING;
break;
case IMAGE_SCN_MEM_SHARED: