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