/* Definitions of target machine for GNU compiler, for Advanced RISC Machines
ARM compilation, AOF Assembler.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rearnsha@armltd.co.uk)
This file is part of GNU CC.
char *aof_text_section ();
#define TEXT_SECTION_ASM_OP aof_text_section ()
-#define SELECT_RTX_SECTION(MODE,RTX) text_section ();
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) text_section ();
char *aof_data_section ();
#define DATA_SECTION_ASM_OP aof_data_section ()
-#define EXTRA_SECTIONS in_zero_init, in_ctor, in_dtor
+#define EXTRA_SECTIONS in_zero_init, in_common
#define EXTRA_SECTION_FUNCTIONS \
ZERO_INIT_SECTION \
-CTOR_SECTION \
-DTOR_SECTION
+COMMON_SECTION
#define ZERO_INIT_SECTION \
void \
} \
}
-#define CTOR_SECTION \
-void \
-ctor_section () \
-{ \
- static int ctors_once = 0; \
- if (in_section != in_ctor) \
- { \
- if (ctors_once) \
- { \
- fprintf (stderr, \
- "Attempt to output more than one ctor section\n"); \
- abort (); \
- } \
- fprintf (asm_out_file, "\t%s\n", CTORS_SECTION_ASM_OP); \
- in_section = in_ctor; \
- ctors_once = 1; \
- } \
-}
-
-#define DTOR_SECTION \
-void \
-dtor_section () \
-{ \
- static int dtors_once = 0; \
- if (in_section != in_dtor) \
- { \
- if (dtors_once) \
- { \
- fprintf (stderr, \
- "Attempt to output more than one dtor section\n"); \
- abort (); \
- } \
- fprintf (asm_out_file, "\t%s\n", DTORS_SECTION_ASM_OP); \
- in_section = in_dtor; \
- dtors_once = 1; \
- } \
+/* Used by ASM_OUTPUT_COMMON (below) to tell varasm.c that we've
+ changed areas. */
+#define COMMON_SECTION \
+void \
+common_section () \
+{ \
+ static int common_count = 1; \
+ if (in_section != in_common) \
+ { \
+ in_section = in_common; \
+ } \
}
-
#define CTOR_LIST_BEGIN \
asm (CTORS_SECTION_ASM_OP); \
extern func_ptr __CTOR_END__[1]; \
#define ASM_FILE_START(STREAM) \
{ \
- extern char *version_string; \
fprintf ((STREAM), "%s Generated by gcc %s for ARM/%s\n", \
ASM_COMMENT_START, version_string, ARM_OS_NAME); \
+ fprintf ((STREAM), "__r0\tRN\t0\n"); \
fprintf ((STREAM), "__a1\tRN\t0\n"); \
fprintf ((STREAM), "__a2\tRN\t1\n"); \
fprintf ((STREAM), "__a3\tRN\t2\n"); \
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
- must define both, or niether. */
+ must define both, or neither. */
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
fputs ("\tEND\n", (STREAM)); \
} while (0);
-#define ASM_IDENTIFY_GCC(STREAM) fputs ("|gcc2_compiled.|\n", (STREAM))
-
#define ASM_COMMENT_START ";"
#define ASM_APP_ON ""
#define ASM_OUTPUT_ASCII(STREAM,PTR,LEN) \
{ \
int i; \
- char *ptr = (PTR); \
+ const char *ptr = (PTR); \
fprintf ((STREAM), "\tDCB"); \
for (i = 0; i < (LEN); i++) \
fprintf ((STREAM), " &%02x%s", \
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n')
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-
/* Output of Uninitialized Variables */
#define ASM_OUTPUT_COMMON(STREAM,NAME,SIZE,ROUNDED) \
- (fprintf ((STREAM), "\tAREA "), \
+ (common_section (), \
+ fprintf ((STREAM), "\tAREA "), \
assemble_name ((STREAM), (NAME)), \
fprintf ((STREAM), ", DATA, COMMON\n\t%% %d\t%s size=%d\n", \
(ROUNDED), ASM_COMMENT_START, SIZE))
arm_main_function = 1; \
} while (0)
-#define ARM_OUTPUT_LABEL(STREAM,NAME) \
+#define ASM_OUTPUT_LABEL(STREAM,NAME) \
do { \
assemble_name (STREAM,NAME); \
fputs ("\n", STREAM); \
} while (0)
-#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
-{ \
- if (output_bytecode) \
- BC_OUTPUT_LABEL (STREAM, NAME); \
- else \
- { \
- ASM_OUTPUT_LABEL (STREAM, NAME); \
- if (! TREE_PUBLIC (DECL)) \
- { \
- fputs ("\tKEEP ", STREAM); \
- ASM_OUTPUT_LABEL (STREAM, NAME); \
- } \
- aof_delete_import ((NAME)); \
- } \
+#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
+{ \
+ if (TARGET_POKE_FUNCTION_NAME) \
+ arm_poke_function_name ((STREAM), (NAME)); \
+ ASM_OUTPUT_LABEL (STREAM, NAME); \
+ if (! TREE_PUBLIC (DECL)) \
+ { \
+ fputs ("\tKEEP ", STREAM); \
+ ASM_OUTPUT_LABEL (STREAM, NAME); \
+ } \
+ aof_delete_import ((NAME)); \
}
#define ASM_DECLARE_OBJECT_NAME(STREAM,NAME,DECL) \
{ \
- if (output_bytecode) \
- BC_OUTPUT_LABEL (STREAM, NAME); \
- else \
+ ASM_OUTPUT_LABEL (STREAM, NAME); \
+ if (! TREE_PUBLIC (DECL)) \
{ \
+ fputs ("\tKEEP ", STREAM); \
ASM_OUTPUT_LABEL (STREAM, NAME); \
- if (! TREE_PUBLIC (DECL)) \
- { \
- fputs ("\tKEEP ", STREAM); \
- ASM_OUTPUT_LABEL (STREAM, NAME); \
- } \
- aof_delete_import ((NAME)); \
} \
+ aof_delete_import ((NAME)); \
}
#define ASM_OUTPUT_EXTERNAL(STREAM,DECL,NAME) \
/* How initialization functions are handled */
-#define CTORS_SECTION_ASM_OP "AREA\t|C$$gnu_ctorsvec|, DATA, READONLY"
-#define DTORS_SECTION_ASM_OP "AREA\t|C$$gnu_dtorsvec|, DATA, READONLY"
-
-#define ASM_OUTPUT_CONSTRUCTOR(STREAM,NAME) \
-do { \
- ctor_section (); \
- fprintf ((STREAM), "\tDCD\t"); \
- assemble_name ((STREAM), (NAME)); \
- fputc ('\n', (STREAM)); \
-} while (0);
-
-#define ASM_OUTPUT_DESTRUCTOR(STREAM,NAME) \
-do { \
- dtor_section (); \
- fprintf ((STREAM), "\tDCD\t"); \
- assemble_name ((STREAM), (NAME)); \
- fputc ('\n', (STREAM)); \
-} while (0);
+#define CTORS_SECTION_ASM_OP "\tAREA\t|C$$gnu_ctorsvec|, DATA, READONLY"
+#define DTORS_SECTION_ASM_OP "\tAREA\t|C$$gnu_dtorsvec|, DATA, READONLY"
/* Output of Assembler Instructions */
#define USER_LABEL_PREFIX ""
#define LOCAL_LABEL_PREFIX ""
+/* AOF does not prefix user function names with an underscore. */
+#define ARM_MCOUNT_NAME "_mcount"
+
/* Output of Dispatch Tables */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,VALUE,REL) \
+#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL) \
fprintf ((STREAM), "\tb\t|L..%d|\n", (VALUE))
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \