]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/arm/elf.h
Merge basic-improvements-branch to trunk
[thirdparty/gcc.git] / gcc / config / arm / elf.h
CommitLineData
d5b7b3ae
RE
1/* Definitions of target machine for GNU compiler.
2 For ARM with ELF obj format.
fa13446b 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
2398fb2a 4 Free Software Foundation, Inc.
b355a481
NC
5 Contributed by Philip Blundell <philb@gnu.org> and
6 Catherine Moore <clm@cygnus.com>
7
8This file is part of GNU CC.
9
10GNU CC is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2, or (at your option)
13any later version.
14
15GNU CC is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with GNU CC; see the file COPYING. If not, write to
22the Free Software Foundation, 59 Temple Place - Suite 330,
23Boston, MA 02111-1307, USA. */
24
be393ecf
NC
25#ifndef OBJECT_FORMAT_ELF
26 #error elf.h included before elfos.h
27#endif
b355a481
NC
28
29#ifndef LOCAL_LABEL_PREFIX
30#define LOCAL_LABEL_PREFIX "."
31#endif
32
6cfc7210 33#ifndef SUBTARGET_CPP_SPEC
52a21fc6 34#define SUBTARGET_CPP_SPEC "-D__ELF__"
b355a481
NC
35#endif
36
fa13446b
RE
37#ifndef SUBTARGET_EXTRA_SPECS
38#define SUBTARGET_EXTRA_SPECS \
57c21a42
JT
39 { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
40 { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
fa13446b
RE
41#endif
42
d5b7b3ae 43#ifndef SUBTARGET_EXTRA_ASM_SPEC
fa13446b 44#define SUBTARGET_EXTRA_ASM_SPEC ""
d5b7b3ae
RE
45#endif
46
57c21a42
JT
47#ifndef SUBTARGET_ASM_FLOAT_SPEC
48#define SUBTARGET_ASM_FLOAT_SPEC "\
49%{mapcs-float:-mfloat} %{msoft-float:-mno-fpu}"
50#endif
51
d5b7b3ae
RE
52#ifndef ASM_SPEC
53#define ASM_SPEC "\
54%{mbig-endian:-EB} \
4d938a09 55%{mlittle-endian:-EL} \
00b89f01
NC
56%{mcpu=*:-mcpu=%*} \
57%{march=*:-march=%*} \
d5b7b3ae 58%{mapcs-*:-mapcs-%*} \
57c21a42 59%(subtarget_asm_float_spec) \
d5b7b3ae 60%{mthumb-interwork:-mthumb-interwork} \
fa13446b 61%(subtarget_extra_asm_spec)"
d5b7b3ae
RE
62#endif
63
be393ecf
NC
64/* The ARM uses @ are a comment character so we need to redefine
65 TYPE_OPERAND_FMT. */
66#undef TYPE_OPERAND_FMT
74c13308 67#define TYPE_OPERAND_FMT "%%%s"
b355a481 68
be393ecf
NC
69/* We might need a ARM specific header to function declarations. */
70#undef ASM_DECLARE_FUNCTION_NAME
2be2ac70
ZW
71#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
72 do \
73 { \
74 ARM_DECLARE_FUNCTION_NAME (FILE, NAME, DECL); \
75 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
76 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
77 ASM_OUTPUT_LABEL(FILE, NAME); \
78 } \
ef179a26 79 while (0)
b355a481 80
be393ecf
NC
81/* We might need an ARM specific trailer for function declarations. */
82#undef ASM_DECLARE_FUNCTION_SIZE
62b10bbc
NC
83#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
84 do \
85 { \
c27ba912 86 ARM_DECLARE_FUNCTION_SIZE (FILE, FNAME, DECL); \
62b10bbc 87 if (!flag_inhibit_size_directive) \
99086d59 88 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
62b10bbc
NC
89 } \
90 while (0)
b355a481
NC
91
92/* Define this macro if jump tables (for `tablejump' insns) should be
93 output in the text section, along with the assembler instructions.
94 Otherwise, the readonly data section is used. */
657d9449
RE
95/* We put ARM jump tables in the text section, because it makes the code
96 more efficient, but for Thumb it's better to put them out of band. */
97#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ARM)
b355a481 98
b355a481 99#ifndef LINK_SPEC
4d938a09 100#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
b355a481
NC
101#endif
102
103/* Run-time Target Specification. */
104#ifndef TARGET_VERSION
105#define TARGET_VERSION fputs (" (ARM/elf)", stderr)
106#endif
107
108#ifndef TARGET_DEFAULT
d5b7b3ae 109#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
b355a481
NC
110#endif
111
112#ifndef MULTILIB_DEFAULTS
d5b7b3ae
RE
113#define MULTILIB_DEFAULTS \
114 { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
b355a481 115#endif
b355a481
NC
116\f
117
b355a481
NC
118/* This outputs a lot of .req's to define alias for various registers.
119 Let's try to avoid this. */
120#ifndef ASM_FILE_START
62b10bbc
NC
121#define ASM_FILE_START(STREAM) \
122 do \
123 { \
62b10bbc
NC
124 fprintf (STREAM, "%s Generated by gcc %s for ARM/elf\n", \
125 ASM_COMMENT_START, version_string); \
6cfc7210
NC
126 output_file_directive (STREAM, main_input_filename); \
127 fprintf (STREAM, ASM_APP_OFF); \
62b10bbc
NC
128 } \
129 while (0)
b355a481 130#endif
b355a481 131\f
be393ecf 132#undef TARGET_ASM_NAMED_SECTION
7c262518 133#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section
b355a481 134\f
be393ecf 135#undef ASM_OUTPUT_ALIGNED_COMMON
30506ece
NC
136#define ASM_OUTPUT_ALIGNED_COMMON(STREAM, NAME, SIZE, ALIGN) \
137 do \
138 { \
139 fprintf (STREAM, "\t.comm\t"); \
140 assemble_name (STREAM, NAME); \
141 fprintf (STREAM, ", %d, %d\n", SIZE, ALIGN); \
142 } \
143 while (0)
30506ece 144
86efdc8e 145/* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */
ed0e6530
PB
146#define NEED_PLT_RELOC flag_pic
147#define NEED_GOT_RELOC flag_pic
86efdc8e 148
84306176
PB
149/* The ELF assembler handles GOT addressing differently to NetBSD. */
150#define GOT_PCREL 0
151
00275db1
PB
152/* Biggest alignment supported by the object file format of this
153 machine. Use this macro to limit the alignment which can be
154 specified using the `__attribute__ ((aligned (N)))' construct. If
155 not defined, the default value is `BIGGEST_ALIGNMENT'. */
62b10bbc 156#define MAX_OFILE_ALIGNMENT (32768 * 8)
00275db1 157
72579062
NC
158/* Align output to a power of two. Note ".align 0" is redundant,
159 and also GAS will treat it as ".align 2" which we do not want. */
160#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
161 do \
162 { \
163 if ((POWER) > 0) \
164 fprintf (STREAM, "\t.align\t%d\n", POWER); \
165 } \
166 while (0)
2ce3a36b
NC
167
168#define SUPPORTS_INIT_PRIORITY 1