leave it undefined and expect system builders to set configure args
correctly. */
+/* One of Darwin's NeXT legacies is the Mach-O format, which is partly
+ like a.out and partly like COFF, with additional features like
+ multi-architecture binary support. */
+
+#define OBJECT_FORMAT_MACHO
+
/* Suppress g++ attempt to link in the math library automatically.
(Some Darwin versions have a libm, but they seem to cause problems
for C++ executables.) */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Don't warn about MacOS-style 'APPL' four-char-constants. */
-
-#undef WARN_FOUR_CHAR_CONSTANTS
-#define WARN_FOUR_CHAR_CONSTANTS 0
-
/* Machine dependent cpp options. */
-/* The sequence here allows us to get a more specific version number
- glued into __APPLE_CC__. Normally this number would be updated as
- part of submitting to a release engineering organization. */
-
-#ifndef APPLE_CC
-#define APPLE_CC 999
-#endif
-
-#define STRINGIFY_THIS(x) # x
-#define REALLY_STRINGIFY(x) STRINGIFY_THIS(x)
-
#undef CPP_SPEC
-#define CPP_SPEC "-D__APPLE_CC__=" REALLY_STRINGIFY(APPLE_CC) " \
- %{static:-D__STATIC__}%{!static:-D__DYNAMIC__}"
+#define CPP_SPEC "%{static:-D__STATIC__}%{!static:-D__DYNAMIC__}"
/* Machine dependent libraries. */
#undef LIB_SPEC
#define LIB_SPEC "%{!static:-lSystem}"
-/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
+/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
- "%{pg:%{static:-lgcrt0.o}%{!static:-lgcrt1.o}} \
- %{!pg:%{static:-lcrt0.o}%{!static:-lcrt1.o}}"
+ "%{pg:%{static:-lgcrt0.o}%{!static:-lgcrt1.o} -lcrt2.o} \
+ %{!pg:%{static:-lcrt0.o}%{!static:-lcrt1.o} -lcrt2.o}"
+
+/* The native Darwin linker doesn't necessarily place files in the order
+ that they're specified on the link line. Thus, it is pointless
+ to put anything in ENDFILE_SPEC. */
+/* #define ENDFILE_SPEC "" */
#undef DOLLARS_IN_IDENTIFIERS
#define DOLLARS_IN_IDENTIFIERS 2
-/* Allow #sccs (but don't do anything). */
-
-#define SCCS_DIRECTIVE
-
/* We use Dbx symbol format. */
-#define DBX_DEBUGGING_INFO
-
-/* Also enable Dwarf 2 as an option. */
-
-#define DWARF2_DEBUGGING_INFO
-
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#define DBX_DEBUGGING_INFO 1
/* When generating stabs debugging, use N_BINCL entries. */
#define DBX_CONTIN_LENGTH 0
-/* gdb needs a null N_SO at the end of each file for scattered loading. */
+/* gdb needs a null N_SO at the end of each file for scattered loading. */
#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
#define TARGET_ASM_CONSTRUCTOR machopic_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR machopic_asm_out_destructor
+/* Always prefix with an underscore. */
+
+#define USER_LABEL_PREFIX "_"
/* Don't output a .file directive. That is only used by the assembler for
error reporting. */
} \
} while (0)
-/* Give ObjcC methods pretty symbol names. */
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t.space %d\n", SIZE)
+
+/* Give ObjC methods pretty symbol names. */
#undef OBJC_GEN_METHOD_LABEL
#define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \
fprintf (FILE, "_%s", xname); \
} while (0)
+/* Output before executable code. */
+#undef TEXT_SECTION_ASM_OP
+#define TEXT_SECTION_ASM_OP ".text"
+
+/* Output before writable data. */
+
+#undef DATA_SECTION_ASM_OP
+#define DATA_SECTION_ASM_OP ".data"
+
#undef ALIGN_ASM_OP
#define ALIGN_ASM_OP ".align"
machopic_define_name (NAME); \
} while (0)
-/* Output nothing for #ident. */
-
-#undef ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, NAME)
-
/* The maximum alignment which the object file format can support.
For Mach-O, this is 2^15. */
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT 0x8000
-/* Create new Mach-O sections. */
+/* Create new Mach-O sections. */
#undef SECTION_FUNCTION
#define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, OBJC) \
".picsymbol_stub", 0) \
SECTION_FUNCTION (darwin_exception_section, \
in_darwin_exception, \
- ".section __TEXT,__gcc_except_tab", 0) \
+ ".section __DATA,__gcc_except_tab", 0) \
SECTION_FUNCTION (darwin_eh_frame_section, \
in_darwin_eh_frame, \
".section __TEXT,__eh_frame", 0) \
fprintf (FILE, "\t"); \
assemble_name (FILE, NAME); \
fprintf (FILE, "=0\n"); \
- assemble_global (NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
} \
} while (0)
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { const char *const _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \
- (fputs (".globl ", FILE), assemble_name (FILE, _x), fputs ("\n", FILE)); \
- }} while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP ".globl "
+#define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
#define MACHOPIC_JUST_INDIRECT (flag_pic == 1)
#define MACHOPIC_PURE (flag_pic == 2)
+#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO darwin_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING darwin_strip_name_encoding
#define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \
#define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section
+#undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
- (((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
+ (((CODE) == 2 && (GLOBAL) == 1) \
+ ? (DW_EH_PE_pcrel | DW_EH_PE_indirect) : \
+ ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
+
+#define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2) \
+ darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2)
+
+#define TARGET_TERMINATE_DW2_EH_FRAME_INFO false
#define DARWIN_REGISTER_TARGET_PRAGMAS(PFILE) \
do { \
cpp_register_pragma (PFILE, 0, "segment", darwin_pragma_ignore); \
cpp_register_pragma (PFILE, 0, "unused", darwin_pragma_unused); \
} while (0)
+
+#undef ASM_APP_ON
+#define ASM_APP_ON ""
+#undef ASM_APP_OFF
+#define ASM_APP_OFF ""