/* Section names. */
section * darwin_sections[NUM_DARWIN_SECTIONS];
+/* True if we're setting __attribute__ ((ms_struct)). */
+int darwin_ms_struct = false;
+
/* A get_unnamed_section callback used to switch to an ObjC section.
DIRECTIVE is as for output_section_asm_op. */
{
if (write_symbols == DWARF2_DEBUG)
{
- static const char * const debugnames[] =
+ static const char * const debugnames[] =
{
DEBUG_FRAME_SECTION,
DEBUG_INFO_SECTION,
int namelen;
switch_to_section (get_section (debugnames[i], SECTION_DEBUG, NULL));
-
+
gcc_assert (strncmp (debugnames[i], "__DWARF,", 8) == 0);
gcc_assert (strchr (debugnames[i] + 8, ','));
-
+
namelen = strchr (debugnames[i] + 8, ',') - (debugnames[i] + 8);
fprintf (asm_out_file, "Lsection%.*s:\n", namelen, debugnames[i] + 8);
}
{
char sname[64];
int namelen;
-
+
gcc_assert (base->common.flags & SECTION_NAMED);
gcc_assert (strncmp (base->named.name, "__DWARF,", 8) == 0);
gcc_assert (strchr (base->named.name + 8, ','));
return default_binds_local_p_1 (decl, 0);
}
+#if 0
+/* See TARGET_ASM_OUTPUT_ANCHOR for why we can't do this yet. */
/* The Darwin's implementation of TARGET_ASM_OUTPUT_ANCHOR. Define the
anchor relative to ".", the current section position. We cannot use
the default one because ASM_OUTPUT_DEF is wrong for Darwin. */
fprintf (asm_out_file, ", . + " HOST_WIDE_INT_PRINT_DEC "\n",
SYMBOL_REF_BLOCK_OFFSET (symbol));
}
+#endif
+
+/* Set the darwin specific attributes on TYPE. */
+void
+darwin_set_default_type_attributes (tree type)
+{
+ if (darwin_ms_struct
+ && TREE_CODE (type) == RECORD_TYPE)
+ TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("ms_struct"),
+ NULL_TREE,
+ TYPE_ATTRIBUTES (type));
+}
#include "gt-darwin.h"