Commit | Line | Data |
---|---|---|
e9f53129 AM |
1 | /* spu.h -- Assembler for spu |
2 | ||
3 | Copyright 2006 Free Software Foundation, Inc. | |
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 | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
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 | |
19 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA | |
20 | 02110-1301, USA. */ | |
21 | ||
22 | #define TC_SPU | |
23 | ||
24 | #ifdef OBJ_ELF | |
25 | #define TARGET_FORMAT "elf32-spu" | |
26 | #define TARGET_ARCH bfd_arch_spu | |
27 | #define TARGET_NAME "elf32-spu" | |
28 | #endif | |
29 | ||
30 | #define TARGET_BYTES_BIG_ENDIAN 1 | |
31 | ||
32 | #ifndef TARGET_NAME | |
33 | #define TARGET_NAME "coff-spu" | |
34 | #endif | |
35 | ||
36 | #ifndef TARGET_ARCH | |
37 | #define TARGET_ARCH bfd_arch_spu | |
38 | #endif | |
39 | ||
40 | #define COFF_MAGIC SPU_MAGIC | |
41 | #define BFD_ARCH bfd_arch_spu | |
42 | ||
43 | #define NEED_FX_R_TYPE | |
44 | #define TC_KEEP_FX_OFFSET | |
45 | /* #define TC_CONS_RELOC RELOC_32 */ | |
46 | ||
47 | /* If defined, fixS will have a member named tc_fix_data of this type. */ | |
48 | #define TC_FIX_TYPE int | |
49 | #define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = 0) | |
50 | ||
51 | /* Don't reduce function symbols to section symbols. */ | |
52 | #define tc_fix_adjustable(FIXP) (!S_IS_FUNCTION ((FIXP)->fx_addsy)) | |
53 | ||
54 | /* Values passed to md_apply_fix don't include symbol values. */ | |
55 | #define MD_APPLY_SYM_VALUE(FIX) 0 | |
56 | ||
57 | /* This expression evaluates to false if the relocation is for a local | |
58 | object for which we still want to do the relocation at runtime. | |
59 | True if we are willing to perform this relocation while building | |
60 | the .o file. This is only used for pcrel relocations. */ | |
61 | ||
62 | #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ | |
63 | ((FIX)->fx_addsy == NULL \ | |
64 | || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ | |
65 | && ! S_IS_WEAK ((FIX)->fx_addsy) \ | |
66 | && S_IS_DEFINED ((FIX)->fx_addsy) \ | |
67 | && ! S_IS_COMMON ((FIX)->fx_addsy))) | |
68 | ||
69 | /* The spu uses pseudo-ops with no leading period. */ | |
70 | #define NO_PSEUDO_DOT 1 | |
71 | ||
72 | /* Don't warn on word overflow; it happens on %hi relocs. */ | |
73 | #undef WARN_SIGNED_OVERFLOW_WORD | |
74 | ||
75 | #ifdef OBJ_ELF | |
76 | #define DIFF_EXPR_OK | |
77 | #endif | |
78 | ||
79 | #define WORKING_DOT_WORD | |
80 | ||
81 | #define md_number_to_chars number_to_chars_bigendian | |
82 | ||
83 | #define md_convert_frag(b,s,f) {as_fatal (_("spu convert_frag\n"));} | |
84 | ||
85 | /* We don't need to do anything special for undefined symbols. */ | |
86 | #define md_undefined_symbol(s) 0 | |
87 | ||
88 | /* We have no special operand handling. */ | |
89 | #define md_operand(e) | |
90 | ||
91 | /* Fill in rs_align_code fragments. */ | |
92 | extern void spu_handle_align PARAMS ((fragS *)); | |
93 | #define HANDLE_ALIGN(frag) spu_handle_align (frag) | |
94 | ||
95 | #define MAX_MEM_FOR_RS_ALIGN_CODE (7 + 8) | |
96 | ||
97 | #ifdef SPUCOFF | |
98 | ||
99 | /* Whether a reloc should be output. */ | |
100 | #define TC_COUNT_RELOC(fixp) ((fixp)->fx_addsy != NULL || (fixp)->fx_subsy != NULL) | |
101 | ||
102 | /* Get the BFD reloc type to use for a gas fixS structure. */ | |
103 | #define TC_COFF_FIX2RTYPE(fixp) tc_coff_fix2rtype (fixp) | |
104 | ||
105 | /* No special hook needed for symbols. */ | |
106 | #define tc_coff_symbol_emit_hook(s) | |
107 | ||
108 | /* Align sections to a four byte boundary. */ | |
109 | #ifndef max | |
110 | #define max(a,b) (((a) > (b)) ? (a) : (b)) | |
111 | #endif | |
112 | #define SUB_SEGMENT_ALIGN(SEG) max (section_alignment[(int) (SEG)], 4) | |
113 | ||
114 | #endif /* SPUCOFF */ |