]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/aarch64/aarch64-elf.h
Update copyright years in gcc/
[thirdparty/gcc.git] / gcc / config / aarch64 / aarch64-elf.h
CommitLineData
43e9d192 1/* Machine description for AArch64 architecture.
23a5b65a 2 Copyright (C) 2009-2014 Free Software Foundation, Inc.
43e9d192
IB
3 Contributed by ARM Ltd.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_AARCH64_ELF_H
22#define GCC_AARCH64_ELF_H
23
24
25#define ASM_OUTPUT_LABELREF(FILE, NAME) \
26 aarch64_asm_output_labelref (FILE, NAME)
27
28#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
29 do \
30 { \
31 assemble_name (FILE, NAME1); \
32 fputs (" = ", FILE); \
33 assemble_name (FILE, NAME2); \
34 fputc ('\n', FILE); \
35 } while (0)
36
37#define TEXT_SECTION_ASM_OP "\t.text"
38#define DATA_SECTION_ASM_OP "\t.data"
39#define BSS_SECTION_ASM_OP "\t.bss"
40
41#define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\"aw\",%init_array"
42#define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\"aw\",%fini_array"
43
44#undef INIT_SECTION_ASM_OP
45#undef FINI_SECTION_ASM_OP
46#define INIT_ARRAY_SECTION_ASM_OP CTORS_SECTION_ASM_OP
47#define FINI_ARRAY_SECTION_ASM_OP DTORS_SECTION_ASM_OP
48
49/* Since we use .init_array/.fini_array we don't need the markers at
50 the start and end of the ctors/dtors arrays. */
51#define CTOR_LIST_BEGIN asm (CTORS_SECTION_ASM_OP)
52#define CTOR_LIST_END /* empty */
53#define DTOR_LIST_BEGIN asm (DTORS_SECTION_ASM_OP)
54#define DTOR_LIST_END /* empty */
55
56#undef TARGET_ASM_CONSTRUCTOR
57#define TARGET_ASM_CONSTRUCTOR aarch64_elf_asm_constructor
58
59#undef TARGET_ASM_DESTRUCTOR
60#define TARGET_ASM_DESTRUCTOR aarch64_elf_asm_destructor
61
62#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
63/* Support for -falign-* switches. Use .p2align to ensure that code
64 sections are padded with NOP instructions, rather than zeros. */
65#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
66 do \
67 { \
68 if ((LOG) != 0) \
69 { \
70 if ((MAX_SKIP) == 0) \
71 fprintf ((FILE), "\t.p2align %d\n", (int) (LOG)); \
72 else \
73 fprintf ((FILE), "\t.p2align %d,,%d\n", \
74 (int) (LOG), (int) (MAX_SKIP)); \
75 } \
76 } while (0)
77
78#endif /* HAVE_GAS_MAX_SKIP_P2ALIGN */
79
80#define JUMP_TABLES_IN_TEXT_SECTION 0
81
82#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
83 do { \
84 switch (GET_MODE (BODY)) \
85 { \
86 case QImode: \
87 asm_fprintf (STREAM, "\t.byte\t(%LL%d - %LLrtx%d) / 4\n", \
88 VALUE, REL); \
89 break; \
90 case HImode: \
91 asm_fprintf (STREAM, "\t.2byte\t(%LL%d - %LLrtx%d) / 4\n", \
92 VALUE, REL); \
93 break; \
94 case SImode: \
95 case DImode: /* See comment in aarch64_output_casesi. */ \
96 asm_fprintf (STREAM, "\t.word\t(%LL%d - %LLrtx%d) / 4\n", \
97 VALUE, REL); \
98 break; \
99 default: \
100 gcc_unreachable (); \
101 } \
102 } while (0)
103
104#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
105 fprintf(STREAM, "\t.align\t%d\n", (int)POWER)
106
107#define ASM_COMMENT_START "//"
108
43e9d192
IB
109#define LOCAL_LABEL_PREFIX "."
110#define USER_LABEL_PREFIX ""
111
112#define GLOBAL_ASM_OP "\t.global\t"
113
17a819cb
YZ
114#ifdef TARGET_BIG_ENDIAN_DEFAULT
115#define ENDIAN_SPEC "-mbig-endian"
116#else
117#define ENDIAN_SPEC "-mlittle-endian"
118#endif
119
120#if TARGET_DATA_MODEL == 1
121#define ABI_SPEC "-mabi=lp64"
122#define MULTILIB_DEFAULTS { "mabi=lp64" }
123#elif TARGET_DATA_MODEL == 2
124#define ABI_SPEC "-mabi=ilp32"
125#define MULTILIB_DEFAULTS { "mabi=ilp32" }
126#else
127#error "Unknown or undefined TARGET_DATA_MODEL!"
128#endif
129
130/* Force the default endianness and ABI flags onto the command line
131 in order to make the other specs easier to write. */
132#undef DRIVER_SELF_SPECS
133#define DRIVER_SELF_SPECS \
134 " %{!mbig-endian:%{!mlittle-endian:" ENDIAN_SPEC "}}" \
135 " %{!mabi=*:" ABI_SPEC "}"
136
63892fa2
KV
137#ifdef HAVE_AS_MABI_OPTION
138#define ASM_MABI_SPEC "%{mabi=*:-mabi=%*}"
139#else
140#define ASM_MABI_SPEC "%{mabi=lp64:}"
141#endif
142
43e9d192
IB
143#ifndef ASM_SPEC
144#define ASM_SPEC "\
145%{mbig-endian:-EB} \
146%{mlittle-endian:-EL} \
147%{mcpu=*:-mcpu=%*} \
682287fb
JG
148%{march=*:-march=%*} \
149%(asm_cpu_spec)" \
63892fa2 150ASM_MABI_SPEC
43e9d192
IB
151#endif
152
153#undef TYPE_OPERAND_FMT
154#define TYPE_OPERAND_FMT "%%%s"
155
156#undef TARGET_ASM_NAMED_SECTION
157#define TARGET_ASM_NAMED_SECTION aarch64_elf_asm_named_section
158
159/* Stabs debug not required. */
160#undef DBX_DEBUGGING_INFO
161
162#endif /* GCC_AARCH64_ELF_H */