/* Configuration file for ARM BPABI targets.
- Copyright (C) 2004, 2005, 2007, 2008
+ Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC
#define TARGET_BPABI (TARGET_AAPCS_BASED)
/* BPABI targets use EABI frame unwinding tables. */
-#define TARGET_UNWIND_INFO 1
+#undef ARM_UNWIND_INFO
+#define ARM_UNWIND_INFO 1
/* Section 4.1 of the AAPCS requires the use of VFP format. */
#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#define FPUTYPE_DEFAULT "vfp"
/* TARGET_BIG_ENDIAN_DEFAULT is set in
config.gcc for big endian configurations. */
/* The BPABI integer comparison routines return { -1, 0, 1 }. */
#define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
+
+#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5"\
+ "|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15:%{!r:--be8}}}"
+
/* Tell the assembler to build BPABI binaries. */
#undef SUBTARGET_EXTRA_ASM_SPEC
-#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}"
+#define SUBTARGET_EXTRA_ASM_SPEC \
+ "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
#ifndef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC ""
#endif
-#define ANDROID_LINK_SPEC \
-"%{mandroid:" \
- "%{!static:" \
- "%{shared: -Bsymbolic} " \
- "%{!shared:" \
- "%{rdynamic:-export-dynamic} " \
- "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}}} "
-
/* The generic link spec in elf.h does not support shared libraries. */
-#undef LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
+#define BPABI_LINK_SPEC \
+ "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
- ANDROID_LINK_SPEC \
- "-X" SUBTARGET_EXTRA_LINK_SPEC
-
-#if defined (__thumb__)
-#define RENAME_LIBRARY_SET ".thumb_set"
-#else
-#define RENAME_LIBRARY_SET ".set"
-#endif
-
-/* Make __aeabi_AEABI_NAME an alias for __GCC_NAME. */
-#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \
- __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n" \
- RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME \
- ", __" #GCC_NAME "\n");
-
-/* Give some libgcc functions an additional __aeabi name. */
-#ifdef L_muldi3
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
-#endif
-#ifdef L_muldi3
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
-#endif
-#ifdef L_fixdfdi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
-#endif
-#ifdef L_fixunsdfdi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
-#endif
-#ifdef L_fixsfdi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
-#endif
-#ifdef L_fixunssfdi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
-#endif
-#ifdef L_floatdidf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
-#endif
-#ifdef L_floatdisf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
-#endif
+ "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC
-/* These renames are needed on ARMv6M. Other targets get them from
- assembly routines. */
-#ifdef L_fixunsdfsi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, d2uiz)
-#endif
-#ifdef L_fixunssfsi
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, f2uiz)
-#endif
-#ifdef L_floatundidf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundidf, ul2d)
-#endif
-#ifdef L_floatundisf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, ul2f)
-#endif
+#undef LINK_SPEC
+#define LINK_SPEC BPABI_LINK_SPEC
/* The BPABI requires that we always use an out-of-line implementation
of RTTI comparison, even if the target supports weak symbols,
do \
{ \
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
- if (TARGET_ANDROID) \
- builtin_define ("__ANDROID__"); \
} \
while (false)
#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
-/* Android uses -fno-rtti and -fno-exceptions by default. */
-
-#undef CC1_SPEC
-#define CC1_SPEC "%{mandroid:%{!fexceptions:-fno-exceptions}}"
-
-#undef CC1PLUS_SPEC
-#define CC1PLUS_SPEC "%{mandroid:%{!frtti:-fno-rtti}}"
-
-/* Startfile and endfile specs are the same as unknown-elf.h except
- for Android. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
-"%{!mandroid:%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}} " \
-"%{mandroid:-lc %{!static:-ldl}}"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
-"%{!mandroid:crti%O%s crtbegin%O%s crt0%O%s} " \
-"%{mandroid:" \
- "%{!shared:" \
- "%{static:crtbegin_static%O%s} " \
- "%{!static:crtbegin_dynamic%O%s}}}"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
-"%{!mandroid:crtend%O%s crtn%O%s} "\
-"%{mandroid:" \
- "%{!shared:crtend%O%s}}"
+/* The legacy _mcount implementation assumes r11 points to a
+ 4-word APCS frame. This is generally not true for EABI targets,
+ particularly not in Thumb mode. We assume the mcount
+ implementation does not require a counter variable (No Counter).
+ Note that __gnu_mcount_nc will be entered with a misaligned stack.
+ This is OK because it uses a special calling convention anyway. */
+
+#undef NO_PROFILE_COUNTERS
+#define NO_PROFILE_COUNTERS 1
+#undef ARM_FUNCTION_PROFILER
+#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
+{ \
+ fprintf (STREAM, "\tpush\t{lr}\n"); \
+ fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
+}
+
+#undef SUBTARGET_FRAME_POINTER_REQUIRED
+#define SUBTARGET_FRAME_POINTER_REQUIRED 0
+
+/* __gnu_mcount_nc restores the original LR value before returning. Ensure
+ that there is no unnecessary hook set up. */
+#undef PROFILE_HOOK