]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - gcc/config/arm/elf.h
Imported gcc-4.4.3
[msp430-gcc.git] / gcc / config / arm / elf.h
index 1cab2c4e144fb2cf3ac4b5155484b150dfba49cb..7c3eddbe05845749832114ee5191f935907c9a88 100644 (file)
@@ -1,26 +1,25 @@
 /* Definitions of target machine for GNU compiler.
    For ARM with ELF obj format.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005, 2007,
+   2008 Free Software Foundation, Inc.
    Contributed by Philip Blundell <philb@gnu.org> and
    Catherine Moore <clm@cygnus.com>
    
-This file is part of GNU CC.
+   This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
 
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef OBJECT_FORMAT_ELF
  #error elf.h included before elfos.h
@@ -36,44 +35,53 @@ Boston, MA 02111-1307, USA.  */
 
 #ifndef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
-  { "subtarget_extra_asm_spec",        SUBTARGET_EXTRA_ASM_SPEC },
+  { "subtarget_extra_asm_spec",        SUBTARGET_EXTRA_ASM_SPEC }, \
+  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  SUBSUBTARGET_EXTRA_SPECS
 #endif
 
 #ifndef SUBTARGET_EXTRA_ASM_SPEC
 #define SUBTARGET_EXTRA_ASM_SPEC ""
 #endif
 
+#ifndef SUBTARGET_ASM_FLOAT_SPEC
+#define SUBTARGET_ASM_FLOAT_SPEC "\
+%{mapcs-float:-mfloat}"
+#endif
+
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS
+
 #ifndef ASM_SPEC
 #define ASM_SPEC "\
 %{mbig-endian:-EB} \
-%{mcpu=*:-m%*} \
-%{march=*:-m%*} \
+%{mlittle-endian:-EL} \
+%{mcpu=*:-mcpu=%*} \
+%{march=*:-march=%*} \
 %{mapcs-*:-mapcs-%*} \
-%{mapcs-float:-mfloat} \
-%{msoft-float:-mno-fpu} \
+%(subtarget_asm_float_spec) \
 %{mthumb-interwork:-mthumb-interwork} \
+%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \
+%{mfloat-abi=*} %{mfpu=*} \
 %(subtarget_extra_asm_spec)"
 #endif
 
 /* The ARM uses @ are a comment character so we need to redefine
    TYPE_OPERAND_FMT.  */
 #undef  TYPE_OPERAND_FMT
-#define TYPE_OPERAND_FMT       "%s"
+#define TYPE_OPERAND_FMT       "%%%s"
 
 /* We might need a ARM specific header to function declarations.  */
 #undef  ASM_DECLARE_FUNCTION_NAME
-#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)    \
-  do                                                   \
-    {                                                  \
-      ARM_DECLARE_FUNCTION_NAME (FILE, NAME, DECL);     \
-      fprintf (FILE, "%s", TYPE_ASM_OP);               \
-      assemble_name (FILE, NAME);                      \
-      putc (',', FILE);                                        \
-      fprintf (FILE, TYPE_OPERAND_FMT, "function");    \
-      putc ('\n', FILE);                               \
-      ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));   \
-      ASM_OUTPUT_LABEL(FILE, NAME);                    \
-    }                                                  \
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)            \
+  do                                                           \
+    {                                                          \
+      ARM_DECLARE_FUNCTION_NAME (FILE, NAME, DECL);            \
+      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");      \
+      ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));           \
+      ASM_OUTPUT_LABEL(FILE, NAME);                            \
+      ARM_OUTPUT_FN_UNWIND (FILE, TRUE);                       \
+    }                                                          \
   while (0)
 
 /* We might need an ARM specific trailer for function declarations.  */
@@ -81,34 +89,22 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)           \
   do                                                           \
     {                                                          \
-      ARM_DECLARE_FUNCTION_SIZE (FILE, FNAME, DECL);           \
+      ARM_OUTPUT_FN_UNWIND (FILE, FALSE);                      \
       if (!flag_inhibit_size_directive)                                \
-        {                                                      \
-          char label[256];                                     \
-         static int labelno;                                   \
-         labelno ++;                                           \
-         ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);  \
-         ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);     \
-         fprintf (FILE, "%s", SIZE_ASM_OP);                    \
-         assemble_name (FILE, (FNAME));                        \
-          fprintf (FILE, ",");                                 \
-         assemble_name (FILE, label);                          \
-          fprintf (FILE, "-");                                 \
-         assemble_name (FILE, (FNAME));                        \
-         putc ('\n', FILE);                                    \
-        }                                                      \
+       ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                 \
     }                                                          \
   while (0)
 
 /* Define this macro if jump tables (for `tablejump' insns) should be
    output in the text section, along with the assembler instructions.
    Otherwise, the readonly data section is used.  */
-/* We put ARM jump tables in the text section, because it makes the code
-   more efficient, but for Thumb it's better to put them out of band.  */
-#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ARM)
+/* We put ARM and Thumb-2 jump tables in the text section, because it makes
+   the code more efficient, but for Thumb-1 it's better to put them out of
+   band.  */
+#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_32BIT)
 
 #ifndef LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} -X"
+#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
 #endif
   
 /* Run-time Target Specification.  */
@@ -117,61 +113,24 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
+#define TARGET_DEFAULT (MASK_APCS_FRAME)
 #endif
 
 #ifndef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
+  { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork", "fno-leading-underscore" }
 #endif
 \f
+#define TARGET_ASM_FILE_START_APP_OFF true
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+\f
 
-/* This outputs a lot of .req's to define alias for various registers.
-   Let's try to avoid this.  */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM)                                 \
-  do                                                           \
-    {                                                          \
-      fprintf (STREAM, "%s Generated by gcc %s for ARM/elf\n", \
-              ASM_COMMENT_START, version_string);              \
-      output_file_directive (STREAM, main_input_filename);     \
-      fprintf (STREAM, ASM_APP_OFF);                           \
-    }                                                          \
-  while (0)
-#endif
+/* Output an element in the static constructor array.  */
+#undef TARGET_ASM_CONSTRUCTOR
+#define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor
 
-/* Output an internal label definition.  */
-#undef  ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM)         \
-  do                                                           \
-    {                                                          \
-      char * s = (char *) alloca (40 + strlen (PREFIX));       \
-      extern int arm_target_label, arm_ccfsm_state;            \
-      extern rtx arm_target_insn;                              \
-                                                               \
-      if (arm_ccfsm_state == 3 && arm_target_label == (NUM)    \
-         && !strcmp (PREFIX, "L"))                             \
-       {                                                       \
-         arm_ccfsm_state = 0;                                  \
-         arm_target_insn = NULL;                               \
-       }                                                       \
-      ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM));                \
-      ASM_OUTPUT_LABEL (STREAM, s);                            \
-    }                                                          \
-  while (0)
-\f
-#undef  TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION  arm_elf_asm_named_section
-\f
-#undef  ASM_OUTPUT_ALIGNED_COMMON
-#define ASM_OUTPUT_ALIGNED_COMMON(STREAM, NAME, SIZE, ALIGN)   \
-  do                                                           \
-    {                                                          \
-      fprintf (STREAM, "\t.comm\t");                           \
-      assemble_name (STREAM, NAME);                            \
-      fprintf (STREAM, ", %d, %d\n", SIZE, ALIGN);             \
-    }                                                          \
-  while (0)
+#undef TARGET_ASM_DESTRUCTOR
+#define TARGET_ASM_DESTRUCTOR arm_elf_asm_destructor
 
 /* For PIC code we need to explicitly specify (PLT) and (GOT) relocs.  */
 #define NEED_PLT_RELOC flag_pic
@@ -180,12 +139,6 @@ Boston, MA 02111-1307, USA.  */
 /* The ELF assembler handles GOT addressing differently to NetBSD.  */
 #define GOT_PCREL      0
 
-/* Biggest alignment supported by the object file format of this
-   machine.  Use this macro to limit the alignment which can be
-   specified using the `__attribute__ ((aligned (N)))' construct.  If
-   not defined, the default value is `BIGGEST_ALIGNMENT'.  */
-#define MAX_OFILE_ALIGNMENT (32768 * 8)
-
 /* Align output to a power of two.  Note ".align 0" is redundant,
    and also GAS will treat it as ".align 2" which we do not want.  */
 #define ASM_OUTPUT_ALIGN(STREAM, POWER)                        \
@@ -196,4 +149,17 @@ Boston, MA 02111-1307, USA.  */
     }                                                  \
   while (0)
 
-#define SUPPORTS_INIT_PRIORITY 1
+/* Horrible hack: We want to prevent some libgcc routines being included
+   for some multilibs.  */
+#ifndef __ARM_ARCH_6M__
+#undef L_fixdfsi
+#undef L_fixunsdfsi
+#undef L_truncdfsf2
+#undef L_fixsfsi
+#undef L_fixunssfsi
+#undef L_floatdidf
+#undef L_floatdisf
+#undef L_floatundidf
+#undef L_floatundisf
+#endif
+