aboutsummaryrefslogtreecommitdiff
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
commit51db370890a1d637175ce846053ca32e3e5a519e (patch)
tree458fd7fb2d8e363e6f2067212d3686db60fccf71 /bfd/coffcode.h
parent88496bb5c69c7702ab2016f0d1997caf1042cbdb (diff)
downloadgdb-51db370890a1d637175ce846053ca32e3e5a519e.zip
gdb-51db370890a1d637175ce846053ca32e3e5a519e.tar.gz
gdb-51db370890a1d637175ce846053ca32e3e5a519e.tar.bz2
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 9c3b2cd..1dac3c3 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