1 /* This file is tc-alpha.h
2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Written by Ken Raeburn <raeburn@cygnus.com>.
6 This file is part of GAS, the GNU Assembler.
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)
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.
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
25 #define TARGET_BYTES_BIG_ENDIAN 0
27 #define WORKING_DOT_WORD
29 #define TARGET_ARCH bfd_arch_alpha
32 #define ELF_TARGET_FORMAT "elf64-alpha-freebsd"
34 #ifndef ELF_TARGET_FORMAT
35 #define ELF_TARGET_FORMAT "elf64-alpha"
38 #define TARGET_FORMAT (OUTPUT_FLAVOR == bfd_target_ecoff_flavour \
39 ? "ecoff-littlealpha" \
40 : OUTPUT_FLAVOR == bfd_target_elf_flavour \
42 : OUTPUT_FLAVOR == bfd_target_evax_flavour \
46 #define NEED_LITERAL_POOL
47 #define REPEAT_CONS_EXPRESSIONS
50 struct alpha_reloc_tag
;
52 extern void alpha_validate_fix
PARAMS ((struct fix
*));
53 extern int alpha_force_relocation
PARAMS ((struct fix
*));
54 extern int alpha_fix_adjustable
PARAMS ((struct fix
*));
56 extern unsigned long alpha_gprmask
, alpha_fprmask
;
57 extern valueT alpha_gp_value
;
60 #define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) alpha_validate_fix (FIX)
62 #define TC_FORCE_RELOCATION(FIX) alpha_force_relocation (FIX)
63 #define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX)
64 #define RELOC_REQUIRES_SYMBOL
66 /* Values passed to md_apply_fix3 don't include the symbol value. */
67 #define MD_APPLY_SYM_VALUE(FIX) 0
69 #define md_convert_frag(b,s,f) as_fatal ("alpha convert_frag\n")
70 #define md_estimate_size_before_relax(f,s) \
71 (as_fatal ("estimate_size_before_relax called"),1)
76 /* This field keeps the symbols position in the link section. */
77 #define OBJ_SYMFIELD_TYPE valueT
79 #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) \
80 fix_new_exp (FRAG, OFF, (int)LEN, EXP, 0, \
81 LEN == 2 ? BFD_RELOC_16 \
82 : LEN == 4 ? BFD_RELOC_32 \
83 : LEN == 8 ? BFD_RELOC_64 \
84 : BFD_RELOC_ALPHA_LINKAGE);
87 #define md_number_to_chars number_to_chars_littleendian
89 extern int tc_get_register
PARAMS ((int frame
));
90 extern void alpha_frob_ecoff_data
PARAMS ((void));
92 #define tc_frob_label(sym) alpha_define_label (sym)
93 extern void alpha_define_label
PARAMS ((symbolS
*));
95 #define md_cons_align(nbytes) alpha_cons_align (nbytes)
96 extern void alpha_cons_align
PARAMS ((int));
98 #define HANDLE_ALIGN(fragp) alpha_handle_align (fragp)
99 extern void alpha_handle_align
PARAMS ((struct frag
*));
101 #define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 8)
104 #define tc_frob_file_before_adjust() alpha_frob_file_before_adjust ()
105 extern void alpha_frob_file_before_adjust
PARAMS ((void));
108 #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
111 #define ELF_TC_SPECIAL_SECTIONS \
112 { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, \
113 { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
115 #define md_elf_section_letter alpha_elf_section_letter
116 extern int alpha_elf_section_letter
PARAMS ((int, char **));
117 #define md_elf_section_flags alpha_elf_section_flags
118 extern flagword alpha_elf_section_flags
PARAMS ((flagword
, int, int));
121 /* Whether to add support for explict !relocation_op!sequence_number. At the
122 moment, only do this for ELF, though ECOFF could use it as well. */
128 /* Before the relocations are written, reorder them, so that user
129 supplied !lituse relocations follow the appropriate !literal
130 relocations. Also convert the gas-internal relocations to the
131 appropriate linker relocations. */
132 #define tc_frob_file_before_fix() alpha_before_fix ()
133 extern void alpha_before_fix
PARAMS ((void));
135 /* New fields for supporting explicit relocations (such as !literal to mark
136 where a pointer is loaded from the global table, and !lituse_base to track
137 all of the normal uses of that pointer). */
139 #define TC_FIX_TYPE struct alpha_fix_tag
143 struct fix
*next_reloc
; /* next !lituse or !gpdisp */
144 struct alpha_reloc_tag
*info
; /* other members with same sequence */
147 /* Initialize the TC_FIX_TYPE field. */
148 #define TC_INIT_FIX_DATA(FIX) \
150 FIX->tc_fix_data.next_reloc = (struct fix *) 0; \
151 FIX->tc_fix_data.info = (struct alpha_reloc_tag *) 0; \
154 /* Work with DEBUG5 to print fields in tc_fix_type. */
155 #define TC_FIX_DATA_PRINT(STREAM, FIX) \
157 if (FIX->tc_fix_data.info) \
158 fprintf (STREAM, "\tinfo = 0x%lx, next_reloc = 0x%lx\n", \
159 (long) FIX->tc_fix_data.info, \
160 (long) FIX->tc_fix_data.next_reloc); \
163 #define DWARF2_LINE_MIN_INSN_LENGTH 4