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