]>
Commit | Line | Data |
---|---|---|
4462d7c4 | 1 | /* tc-loongarch.h -- Header file for tc-loongarch.c. |
a2c58332 | 2 | Copyright (C) 2021-2022 Free Software Foundation, Inc. |
4462d7c4 | 3 | Contributed by Loongson Ltd. |
4 | ||
5 | This file is part of GAS. | |
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 of the license, or | |
10 | (at your option) 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 this program; see the file COPYING3. If not, | |
19 | see <http://www.gnu.org/licenses/>. */ | |
20 | ||
21 | #ifndef TC_LOONGARCH | |
22 | #define TC_LOONGARCH | |
23 | ||
24 | #define TARGET_BYTES_BIG_ENDIAN 0 | |
25 | #define TARGET_ARCH bfd_arch_loongarch | |
26 | ||
27 | #define WORKING_DOT_WORD 1 | |
28 | #define REPEAT_CONS_EXPRESSIONS | |
29 | ||
30 | /* Early than md_begin. */ | |
31 | #define md_after_parse_args loongarch_after_parse_args | |
32 | extern void loongarch_after_parse_args (void); | |
33 | ||
34 | extern void loongarch_pop_insert (void); | |
35 | #define md_pop_insert() loongarch_pop_insert () | |
36 | ||
37 | #define TARGET_FORMAT loongarch_target_format () | |
38 | extern const char *loongarch_target_format (void); | |
39 | ||
40 | #define md_relax_frag(segment, fragp, stretch) \ | |
41 | loongarch_relax_frag (segment, fragp, stretch) | |
42 | extern int loongarch_relax_frag (asection *, struct frag *, long); | |
43 | #define md_section_align(seg, size) (size) | |
44 | #define md_undefined_symbol(name) (0) | |
45 | #define md_operand(x) | |
46 | ||
47 | /* This is called to see whether a reloc against a defined symbol | |
48 | should be converted into a reloc against a section. */ | |
49 | #define tc_fix_adjustable(fixp) 0 | |
50 | ||
51 | /* Values passed to md_apply_fix don't include symbol values. */ | |
52 | #define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1 | |
53 | #define TC_VALIDATE_FIX_SUB(FIX, SEG) 1 | |
54 | #define DIFF_EXPR_OK 1 | |
55 | ||
56 | #define TARGET_USE_CFIPOP 1 | |
57 | #define DWARF2_DEFAULT_RETURN_COLUMN 1 /* $ra. */ | |
58 | #define DWARF2_CIE_DATA_ALIGNMENT -4 | |
59 | extern int loongarch_dwarf2_addr_size (void); | |
60 | #define DWARF2_FDE_RELOC_SIZE loongarch_dwarf2_addr_size () | |
61 | #define DWARF2_ADDR_SIZE(bfd) loongarch_dwarf2_addr_size () | |
62 | #define CFI_DIFF_EXPR_OK 0 | |
63 | ||
64 | #define tc_cfi_frame_initial_instructions \ | |
65 | loongarch_cfi_frame_initial_instructions | |
66 | extern void loongarch_cfi_frame_initial_instructions (void); | |
67 | ||
68 | #define tc_parse_to_dw2regnum tc_loongarch_parse_to_dw2regnum | |
69 | extern void tc_loongarch_parse_to_dw2regnum (expressionS *); | |
70 | ||
71 | /* A enumerated values to specific how to deal with align in '.text'. | |
72 | Now we want to fill 'andi $r0,$r0,0x0'. | |
73 | Here is the type 0, will fill andi insn later. */ | |
74 | #define NOP_OPCODE (0x00) | |
75 | ||
76 | #define HANDLE_ALIGN(fragp) loongarch_handle_align (fragp) | |
77 | extern void loongarch_handle_align (struct frag *); | |
78 | #define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4) | |
79 | ||
80 | #define elf_tc_final_processing loongarch_elf_final_processing | |
81 | extern void loongarch_elf_final_processing (void); | |
82 | ||
83 | #define MAX_RELOC_NUMBER_A_INSN 20 | |
84 | ||
85 | struct reloc_info | |
86 | { | |
87 | bfd_reloc_code_real_type type; | |
88 | expressionS value; | |
89 | }; | |
90 | ||
91 | #endif |