Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* This file is tc-alpha.h |
4b95cf5c | 2 | Copyright (C) 1994-2014 Free Software Foundation, Inc. |
252b5132 RH |
3 | Written by Ken Raeburn <raeburn@cygnus.com>. |
4 | ||
5 | This file is part of GAS, the GNU Assembler. | |
6 | ||
7 | GAS is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
252b5132 RH |
10 | any later version. |
11 | ||
12 | GAS is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
19 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
20 | 02110-1301, USA. */ | |
252b5132 RH |
21 | |
22 | #define TC_ALPHA | |
23 | ||
24 | #define TARGET_BYTES_BIG_ENDIAN 0 | |
25 | ||
26 | #define WORKING_DOT_WORD | |
27 | ||
28 | #define TARGET_ARCH bfd_arch_alpha | |
29 | ||
4ada7262 DB |
30 | #ifdef TE_FreeBSD |
31 | #define ELF_TARGET_FORMAT "elf64-alpha-freebsd" | |
32 | #endif | |
33 | #ifndef ELF_TARGET_FORMAT | |
34 | #define ELF_TARGET_FORMAT "elf64-alpha" | |
35 | #endif | |
36 | ||
252b5132 RH |
37 | #define TARGET_FORMAT (OUTPUT_FLAVOR == bfd_target_ecoff_flavour \ |
38 | ? "ecoff-littlealpha" \ | |
39 | : OUTPUT_FLAVOR == bfd_target_elf_flavour \ | |
4ada7262 | 40 | ? ELF_TARGET_FORMAT \ |
252b5132 RH |
41 | : OUTPUT_FLAVOR == bfd_target_evax_flavour \ |
42 | ? "vms-alpha" \ | |
43 | : "unknown-format") | |
44 | ||
45 | #define NEED_LITERAL_POOL | |
252b5132 RH |
46 | #define REPEAT_CONS_EXPRESSIONS |
47 | ||
a161fe53 AM |
48 | struct fix; |
49 | struct alpha_reloc_tag; | |
50 | ||
ea1562b3 NC |
51 | extern int alpha_force_relocation (struct fix *); |
52 | extern int alpha_fix_adjustable (struct fix *); | |
252b5132 RH |
53 | |
54 | extern unsigned long alpha_gprmask, alpha_fprmask; | |
55 | extern valueT alpha_gp_value; | |
56 | ||
a161fe53 AM |
57 | #define TC_FORCE_RELOCATION(FIX) alpha_force_relocation (FIX) |
58 | #define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX) | |
252b5132 RH |
59 | #define RELOC_REQUIRES_SYMBOL |
60 | ||
55cf6793 | 61 | /* Values passed to md_apply_fix don't include the symbol value. */ |
a161fe53 | 62 | #define MD_APPLY_SYM_VALUE(FIX) 0 |
252b5132 RH |
63 | |
64 | #define md_convert_frag(b,s,f) as_fatal ("alpha convert_frag\n") | |
65 | #define md_estimate_size_before_relax(f,s) \ | |
07726851 | 66 | (as_fatal ("estimate_size_before_relax called"),1) |
252b5132 RH |
67 | #define md_operand(x) |
68 | ||
69 | #ifdef OBJ_EVAX | |
198f1251 | 70 | #define TC_VALIDATE_FIX_SUB(FIX, SEG) 1 |
252b5132 | 71 | |
198f1251 | 72 | #define tc_canonicalize_symbol_name evax_shorten_name |
252b5132 RH |
73 | |
74 | #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) \ | |
75 | fix_new_exp (FRAG, OFF, (int)LEN, EXP, 0, \ | |
76 | LEN == 2 ? BFD_RELOC_16 \ | |
77 | : LEN == 4 ? BFD_RELOC_32 \ | |
78 | : LEN == 8 ? BFD_RELOC_64 \ | |
79 | : BFD_RELOC_ALPHA_LINKAGE); | |
80 | #endif | |
81 | ||
198f1251 TG |
82 | #ifdef OBJ_EVAX |
83 | #define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 3 | |
84 | #else | |
e13bab5a AM |
85 | #define TC_IMPLICIT_LCOMM_ALIGNMENT(size, align) \ |
86 | do \ | |
87 | { \ | |
88 | align = 0; \ | |
89 | if (size > 1) \ | |
90 | { \ | |
91 | addressT temp = 1; \ | |
92 | while ((size & temp) == 0) \ | |
93 | ++align, temp <<= 1; \ | |
94 | } \ | |
95 | } \ | |
96 | while (0) | |
97 | #endif | |
98 | ||
252b5132 RH |
99 | #define md_number_to_chars number_to_chars_littleendian |
100 | ||
ea1562b3 NC |
101 | extern int tc_get_register (int); |
102 | extern void alpha_frob_ecoff_data (void); | |
252b5132 RH |
103 | |
104 | #define tc_frob_label(sym) alpha_define_label (sym) | |
ea1562b3 | 105 | extern void alpha_define_label (symbolS *); |
252b5132 RH |
106 | |
107 | #define md_cons_align(nbytes) alpha_cons_align (nbytes) | |
ea1562b3 | 108 | extern void alpha_cons_align (int); |
252b5132 | 109 | |
0a9ef439 | 110 | #define HANDLE_ALIGN(fragp) alpha_handle_align (fragp) |
ea1562b3 | 111 | extern void alpha_handle_align (struct frag *); |
0a9ef439 RH |
112 | |
113 | #define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 8) | |
114 | ||
252b5132 RH |
115 | #ifdef OBJ_ECOFF |
116 | #define tc_frob_file_before_adjust() alpha_frob_file_before_adjust () | |
ea1562b3 | 117 | extern void alpha_frob_file_before_adjust (void); |
252b5132 RH |
118 | #endif |
119 | ||
ea1562b3 | 120 | #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */ |
252b5132 RH |
121 | |
122 | #ifdef OBJ_ELF | |
d61a78a7 | 123 | #define md_elf_section_letter alpha_elf_section_letter |
01e1a5bc | 124 | extern bfd_vma alpha_elf_section_letter (int, char **); |
d61a78a7 | 125 | #define md_elf_section_flags alpha_elf_section_flags |
01e1a5bc | 126 | extern flagword alpha_elf_section_flags (flagword, bfd_vma, int); |
252b5132 | 127 | #endif |
43b4c25e | 128 | |
2d2255b5 | 129 | /* Whether to add support for explicit !relocation_op!sequence_number. At the |
43b4c25e MM |
130 | moment, only do this for ELF, though ECOFF could use it as well. */ |
131 | ||
132 | #ifdef OBJ_ELF | |
133 | #define RELOC_OP_P | |
134 | #endif | |
135 | ||
198f1251 | 136 | #ifndef OBJ_EVAX |
19f78583 RH |
137 | /* Before the relocations are written, reorder them, so that user |
138 | supplied !lituse relocations follow the appropriate !literal | |
139 | relocations. Also convert the gas-internal relocations to the | |
140 | appropriate linker relocations. */ | |
a161fe53 | 141 | #define tc_frob_file_before_fix() alpha_before_fix () |
ea1562b3 | 142 | extern void alpha_before_fix (void); |
198f1251 | 143 | #endif |
43b4c25e | 144 | |
f37f01cf RH |
145 | #ifdef OBJ_ELF |
146 | #define md_end alpha_elf_md_end | |
ea1562b3 | 147 | extern void alpha_elf_md_end (void); |
f37f01cf RH |
148 | #endif |
149 | ||
43b4c25e MM |
150 | /* New fields for supporting explicit relocations (such as !literal to mark |
151 | where a pointer is loaded from the global table, and !lituse_base to track | |
152 | all of the normal uses of that pointer). */ | |
153 | ||
154 | #define TC_FIX_TYPE struct alpha_fix_tag | |
155 | ||
156 | struct alpha_fix_tag | |
157 | { | |
ea1562b3 NC |
158 | struct fix *next_reloc; /* Next !lituse or !gpdisp. */ |
159 | struct alpha_reloc_tag *info; /* Other members with same sequence. */ | |
43b4c25e MM |
160 | }; |
161 | ||
162 | /* Initialize the TC_FIX_TYPE field. */ | |
a161fe53 | 163 | #define TC_INIT_FIX_DATA(FIX) \ |
43b4c25e | 164 | do { \ |
ea1562b3 NC |
165 | FIX->tc_fix_data.next_reloc = NULL; \ |
166 | FIX->tc_fix_data.info = NULL; \ | |
43b4c25e MM |
167 | } while (0) |
168 | ||
169 | /* Work with DEBUG5 to print fields in tc_fix_type. */ | |
a161fe53 | 170 | #define TC_FIX_DATA_PRINT(STREAM, FIX) \ |
43b4c25e | 171 | do { \ |
a161fe53 AM |
172 | if (FIX->tc_fix_data.info) \ |
173 | fprintf (STREAM, "\tinfo = 0x%lx, next_reloc = 0x%lx\n", \ | |
174 | (long) FIX->tc_fix_data.info, \ | |
175 | (long) FIX->tc_fix_data.next_reloc); \ | |
43b4c25e | 176 | } while (0) |
4dc7ead9 | 177 | |
f4b97536 RH |
178 | #define TARGET_USE_CFIPOP 1 |
179 | ||
180 | #define tc_cfi_frame_initial_instructions alpha_cfi_frame_initial_instructions | |
ea1562b3 | 181 | extern void alpha_cfi_frame_initial_instructions (void); |
f4b97536 | 182 | |
f37f01cf RH |
183 | #define DWARF2_LINE_MIN_INSN_LENGTH 4 |
184 | #define DWARF2_DEFAULT_RETURN_COLUMN 26 | |
8d79fd44 | 185 | #define DWARF2_CIE_DATA_ALIGNMENT (-8) |