summaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-12-08 22:50:07 +0000
committerNick Clifton <nickc@redhat.com>2000-12-08 22:50:07 +0000
commitc9cdc3388a034f956693d4aa77a8c8dcd7b5a1de (patch)
tree791f367e68a17ef7412cb90eeca514eecbaf09c5 /bfd/coffcode.h
parent21e8e769840ada3e5d87af2e626799029cfde390 (diff)
downloadgdb-c9cdc3388a034f956693d4aa77a8c8dcd7b5a1de.tar.gz
Generalize DWARF2 and COFF support.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h42
1 files changed, 30 insertions, 12 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 9c3b2cdd50a..1dac3c3ac1b 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -349,6 +349,19 @@ static PTR coff_mkobject_hook PARAMS ((bfd *, PTR, PTR));
#ifndef COFF_WITH_PE
+/* Macros for setting debugging flags. */
+#ifdef STYP_DEBUG
+#define STYP_XCOFF_DEBUG STYP_DEBUG
+#else
+#define STYP_XCOFF_DEBUG STYP_INFO
+#endif
+
+#ifdef COFF_ALIGN_IN_S_FLAGS
+#define STYP_DEBUG_INFO STYP_DSECT
+#else
+#define STYP_DEBUG_INFO STYP_INFO
+#endif
+
static long
sec_to_styp_flags (sec_name, sec_flags)
CONST char *sec_name;
@@ -386,22 +399,24 @@ sec_to_styp_flags (sec_name, sec_flags)
styp_flags = STYP_LIT;
#endif /* _LIT */
}
- else if (!strcmp (sec_name, ".debug"))
+ else if (!strncmp (sec_name, ".debug", 6))
{
-#ifdef STYP_DEBUG
- styp_flags = STYP_DEBUG;
-#else
- styp_flags = STYP_INFO;
-#endif
+ /* Handle the XCOFF debug section and DWARF2 debug sections. */
+ if (!sec_name[6])
+ styp_flags = STYP_XCOFF_DEBUG;
+ else
+ styp_flags = STYP_DEBUG_INFO;
}
else if (!strncmp (sec_name, ".stab", 5))
{
-#ifdef COFF_ALIGN_IN_S_FLAGS
- styp_flags = STYP_DSECT;
-#else
- styp_flags = STYP_INFO;
-#endif
+ styp_flags = STYP_DEBUG_INFO;
}
+#ifdef COFF_LONG_SECTION_NAMES
+ else if (!strncmp (sec_name, ".gnu.linkonce.wi.", 17))
+ {
+ styp_flags = STYP_DEBUG_INFO;
+ }
+#endif
#ifdef RS6000COFF_C
else if (!strcmp (sec_name, _PAD))
{
@@ -626,10 +641,13 @@ styp_to_sec_flags (abfd, hdr, name, section)
#endif
sec_flags |= SEC_ALLOC;
}
- else if (strcmp (name, ".debug") == 0
+ else if (strncmp (name, ".debug", 6) == 0
#ifdef _COMMENT
|| strcmp (name, _COMMENT) == 0
#endif
+#ifdef COFF_LONG_SECTION_NAMES
+ || strncmp (name, ".gnu.linkonce.wi.", 17) == 0
+#endif
|| strncmp (name, ".stab", 5) == 0)
{
#ifdef COFF_PAGE_SIZE