2002-02-01 18:16:02 +00:00
|
|
|
|
/* Definitions of target machine for GNU compiler.
|
|
|
|
|
For ARM with ELF obj format.
|
2007-05-19 01:19:51 +00:00
|
|
|
|
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005
|
2002-02-01 18:16:02 +00:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
Contributed by Philip Blundell <philb@gnu.org> and
|
|
|
|
|
Catherine Moore <clm@cygnus.com>
|
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
This file is part of GCC.
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
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 2, or (at your
|
|
|
|
|
option) any later version.
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
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.
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GCC; see the file COPYING. If not, write to
|
2007-05-19 01:19:51 +00:00
|
|
|
|
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
|
Boston, MA 02110-1301, USA. */
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
|
|
#ifndef OBJECT_FORMAT_ELF
|
|
|
|
|
#error elf.h included before elfos.h
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef LOCAL_LABEL_PREFIX
|
|
|
|
|
#define LOCAL_LABEL_PREFIX "."
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SUBTARGET_CPP_SPEC
|
|
|
|
|
#define SUBTARGET_CPP_SPEC "-D__ELF__"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SUBTARGET_EXTRA_SPECS
|
|
|
|
|
#define SUBTARGET_EXTRA_SPECS \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
{ "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
|
|
|
|
|
{ "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SUBTARGET_EXTRA_ASM_SPEC
|
|
|
|
|
#define SUBTARGET_EXTRA_ASM_SPEC ""
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#ifndef SUBTARGET_ASM_FLOAT_SPEC
|
|
|
|
|
#define SUBTARGET_ASM_FLOAT_SPEC "\
|
2007-05-19 01:19:51 +00:00
|
|
|
|
%{mapcs-float:-mfloat}"
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#ifndef ASM_SPEC
|
|
|
|
|
#define ASM_SPEC "\
|
|
|
|
|
%{mbig-endian:-EB} \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
%{mlittle-endian:-EL} \
|
|
|
|
|
%{mcpu=*:-mcpu=%*} \
|
|
|
|
|
%{march=*:-march=%*} \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
%{mapcs-*:-mapcs-%*} \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
%(subtarget_asm_float_spec) \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
%{mthumb-interwork:-mthumb-interwork} \
|
2007-05-19 01:19:51 +00:00
|
|
|
|
%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \
|
|
|
|
|
%{mfloat-abi=*} %{mfpu=*} \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
%(subtarget_extra_asm_spec)"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* The ARM uses @ are a comment character so we need to redefine
|
|
|
|
|
TYPE_OPERAND_FMT. */
|
|
|
|
|
#undef TYPE_OPERAND_FMT
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#define TYPE_OPERAND_FMT "%%%s"
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
|
|
/* We might need a ARM specific header to function declarations. */
|
|
|
|
|
#undef ASM_DECLARE_FUNCTION_NAME
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#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); \
|
2007-05-19 01:19:51 +00:00
|
|
|
|
ARM_OUTPUT_FN_UNWIND (FILE, TRUE); \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
} \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
|
|
/* We might need an ARM specific trailer for function declarations. */
|
|
|
|
|
#undef ASM_DECLARE_FUNCTION_SIZE
|
|
|
|
|
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
2007-05-19 01:19:51 +00:00
|
|
|
|
ARM_OUTPUT_FN_UNWIND (FILE, FALSE); \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
ARM_DECLARE_FUNCTION_SIZE (FILE, FNAME, DECL); \
|
|
|
|
|
if (!flag_inhibit_size_directive) \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
|
2002-02-01 18:16:02 +00:00
|
|
|
|
} \
|
|
|
|
|
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. */
|
2002-05-09 20:02:13 +00:00
|
|
|
|
/* 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)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
|
|
#ifndef LINK_SPEC
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Run-time Target Specification. */
|
|
|
|
|
#ifndef TARGET_VERSION
|
|
|
|
|
#define TARGET_VERSION fputs (" (ARM/elf)", stderr)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef TARGET_DEFAULT
|
2007-05-19 01:19:51 +00:00
|
|
|
|
#define TARGET_DEFAULT (MASK_APCS_FRAME)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef MULTILIB_DEFAULTS
|
|
|
|
|
#define MULTILIB_DEFAULTS \
|
2007-05-19 01:19:51 +00:00
|
|
|
|
{ "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork", "fno-leading-underscore" }
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
#define TARGET_ASM_FILE_START_APP_OFF true
|
|
|
|
|
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
2007-05-19 01:19:51 +00:00
|
|
|
|
|
|
|
|
|
/* Output an element in the static constructor array. */
|
|
|
|
|
#undef TARGET_ASM_CONSTRUCTOR
|
|
|
|
|
#define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
|
|
/* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */
|
|
|
|
|
#define NEED_PLT_RELOC flag_pic
|
|
|
|
|
#define NEED_GOT_RELOC flag_pic
|
|
|
|
|
|
|
|
|
|
/* 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) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
if ((POWER) > 0) \
|
|
|
|
|
fprintf (STREAM, "\t.align\t%d\n", POWER); \
|
|
|
|
|
} \
|
|
|
|
|
while (0)
|
|
|
|
|
|
2007-05-19 01:19:51 +00:00
|
|
|
|
/* The EABI doesn't provide a way of implementing init_priority. */
|
|
|
|
|
#define SUPPORTS_INIT_PRIORITY (!TARGET_AAPCS_BASED)
|