Commit | Line | Data |
---|---|---|
7ba29e2a NC |
1 | /* tc-microblaze.h -- Header file for tc-microblaze.c. |
2 | ||
3 | Copyright 2009 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 3, 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 | #ifndef TC_MICROBLAZE | |
23 | #define TC_MICROBLAZE 1 | |
24 | ||
25 | #define TARGET_ARCH bfd_arch_microblaze | |
26 | /* Used to initialise target_big_endian. */ | |
27 | #define TARGET_BYTES_BIG_ENDIAN 1 | |
28 | ||
29 | #define IGNORE_NONSTANDARD_ESCAPES | |
30 | ||
31 | #define TC_RELOC_MANGLE(a,b,c) tc_reloc_mangle (a, b, c) | |
32 | ||
33 | /* We need to handle expressions of type "symbol op symbol" and create | |
34 | relocs for such expressions as -relax in linker can change the value | |
35 | of such expressions */ | |
36 | #define TC_CONS_FIX_NEW cons_fix_new_microblaze | |
37 | #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) parse_cons_expression_microblaze (EXP, NBYTES) | |
38 | extern void parse_cons_expression_microblaze PARAMS ((expressionS *, int)); | |
39 | ||
40 | #define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) 1 | |
41 | #define UNDEFINED_DIFFERENCE_OK 1 | |
42 | ||
43 | #define TC_FORCE_RELOCATION_LOCAL(FIX) \ | |
44 | (!(FIX)->fx_pcrel \ | |
45 | || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOT \ | |
46 | || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_PLT \ | |
47 | || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOTOFF \ | |
48 | || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_32_GOTOFF \ | |
49 | || TC_FORCE_RELOCATION (FIX)) | |
50 | ||
51 | #define tc_fix_adjustable(X) tc_microblaze_fix_adjustable(X) | |
52 | extern int tc_microblaze_fix_adjustable (struct fix *); | |
53 | ||
54 | extern const struct relax_type md_relax_table[]; | |
55 | #define TC_GENERIC_RELAX_TABLE md_relax_table | |
56 | ||
57 | /* We don't need to handle .word strangely. */ | |
58 | #define WORKING_DOT_WORD | |
59 | ||
60 | #define LISTING_HEADER "Xilinx MicroBlaze GAS Listing" | |
61 | #define LISTING_LHS_CONT_LINES 4 | |
62 | ||
63 | #define NEED_FX_R_TYPE 1 | |
64 | ||
65 | /* We want local label support. */ | |
66 | #define LOCAL_LABELS_FB 1 | |
67 | ||
68 | /* Want the section information too... */ | |
69 | #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) | |
70 | ||
71 | #define MD_APPLY_FIX3 /* We want the segment as well. */ | |
72 | ||
73 | /* We set the fx_done field appropriately in md_apply_fix. */ | |
74 | #define TC_HANDLES_FX_DONE | |
75 | ||
76 | #ifdef OBJ_ELF | |
77 | ||
78 | #define TARGET_FORMAT (target_big_endian ? "elf32-microblaze" : "elf32-microblaze-little") | |
79 | ||
80 | #define ELF_TC_SPECIAL_SECTIONS \ | |
81 | { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ | |
82 | { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \ | |
83 | { ".sdata2", SHT_PROGBITS, SHF_ALLOC }, \ | |
84 | { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \ | |
85 | /* Other special sections not generated by the assembler: .reginfo, | |
86 | .liblist, .conflict, .gptab, .got, .dynamic, .rel.dyn. */ | |
87 | ||
88 | #endif /* OBJ_ELF */ | |
89 | ||
90 | #ifndef TARGET_FORMAT | |
91 | # error No target format specified. | |
92 | #endif | |
93 | ||
94 | #include "write.h" /* For definition of fixS */ | |
95 | ||
96 | extern void md_begin (void); | |
97 | extern void md_assemble (char *); | |
98 | extern symbolS * md_undefined_symbol (char *); | |
99 | extern char * md_atof (int, char *, int *); | |
100 | extern int md_parse_option (int, char *); | |
101 | extern void md_show_usage (FILE *); | |
102 | extern void md_convert_frag (bfd *, segT, fragS *); | |
103 | extern void md_operand (expressionS *); | |
104 | extern int md_estimate_size_before_relax (fragS *, segT); | |
105 | extern void md_number_to_chars (char *, valueT, int); | |
106 | extern valueT md_section_align (segT, valueT); | |
107 | extern long md_pcrel_from_section (fixS *, segT); | |
108 | extern arelent * tc_gen_reloc (asection *, fixS *); | |
109 | extern void cons_fix_new_microblaze (fragS *, int, int, expressionS *); | |
110 | extern void md_apply_fix3 (fixS *, valueT *, segT); | |
111 | ||
112 | #define EXTERN_FORCE_RELOC -1 | |
113 | ||
114 | #endif /* TC_MICROBLAZE */ |