/src/binutils-gdb/gas/config/tc-i386.h
Line | Count | Source |
1 | | /* tc-i386.h -- Header file for tc-i386.c |
2 | | Copyright (C) 1989-2026 Free Software Foundation, Inc. |
3 | | |
4 | | This file is part of GAS, the GNU Assembler. |
5 | | |
6 | | GAS is free software; you can redistribute it and/or modify |
7 | | it under the terms of the GNU General Public License as published by |
8 | | the Free Software Foundation; either version 3, or (at your option) |
9 | | any later version. |
10 | | |
11 | | GAS is distributed in the hope that it will be useful, |
12 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | GNU General Public License for more details. |
15 | | |
16 | | You should have received a copy of the GNU General Public License |
17 | | along with GAS; see the file COPYING. If not, write to the Free |
18 | | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
19 | | 02110-1301, USA. */ |
20 | | |
21 | | #ifndef TC_I386 |
22 | | #define TC_I386 1 |
23 | | |
24 | | #include "opcodes/i386-opc.h" |
25 | | |
26 | | struct fix; |
27 | | |
28 | | #define TARGET_BYTES_BIG_ENDIAN 0 |
29 | | |
30 | | #define TARGET_ARCH (i386_arch ()) |
31 | | #define TARGET_MACH (i386_mach ()) |
32 | | extern enum bfd_architecture i386_arch (void); |
33 | | extern unsigned long i386_mach (void); |
34 | | |
35 | | #ifdef TE_FreeBSD |
36 | | #define AOUT_TARGET_FORMAT "a.out-i386-freebsd" |
37 | | #endif |
38 | | #ifdef TE_NetBSD |
39 | | #define AOUT_TARGET_FORMAT "a.out-i386-netbsd" |
40 | | #endif |
41 | | #ifdef TE_386BSD |
42 | | #define AOUT_TARGET_FORMAT "a.out-i386-bsd" |
43 | | #endif |
44 | | #ifdef TE_LINUX |
45 | | #define AOUT_TARGET_FORMAT "a.out-i386-linux" |
46 | | #endif |
47 | | #ifdef TE_Mach |
48 | | #define AOUT_TARGET_FORMAT "a.out-mach3" |
49 | | #endif |
50 | | #ifdef TE_DYNIX |
51 | | #define AOUT_TARGET_FORMAT "a.out-i386-dynix" |
52 | | #endif |
53 | | #ifndef AOUT_TARGET_FORMAT |
54 | | #define AOUT_TARGET_FORMAT "a.out-i386" |
55 | | #endif |
56 | | |
57 | | #ifdef TE_FreeBSD |
58 | | #define ELF_TARGET_FORMAT "elf32-i386-freebsd" |
59 | | #define ELF_TARGET_FORMAT64 "elf64-x86-64-freebsd" |
60 | | #elif defined (TE_VXWORKS) |
61 | | #define ELF_TARGET_FORMAT "elf32-i386-vxworks" |
62 | | #endif |
63 | | |
64 | | #ifdef TE_SOLARIS |
65 | | #define ELF_TARGET_FORMAT "elf32-i386-sol2" |
66 | | #define ELF_TARGET_FORMAT64 "elf64-x86-64-sol2" |
67 | | #endif |
68 | | |
69 | | #ifndef ELF_TARGET_FORMAT |
70 | 0 | #define ELF_TARGET_FORMAT "elf32-i386" |
71 | | #endif |
72 | | |
73 | | #ifndef ELF_TARGET_FORMAT64 |
74 | 207 | #define ELF_TARGET_FORMAT64 "elf64-x86-64" |
75 | | #endif |
76 | | |
77 | | #ifndef ELF_TARGET_FORMAT32 |
78 | 0 | #define ELF_TARGET_FORMAT32 "elf32-x86-64" |
79 | | #endif |
80 | | |
81 | | #ifndef ELF_TARGET_IAMCU_FORMAT |
82 | 0 | #define ELF_TARGET_IAMCU_FORMAT "elf32-iamcu" |
83 | | #endif |
84 | | |
85 | | #if (defined (OBJ_ELF) || defined (TE_PE) || defined (OBJ_MACH_O)) |
86 | | extern const char *i386_target_format (void); |
87 | 207 | #define TARGET_FORMAT i386_target_format () |
88 | | #else |
89 | | #ifdef TE_GO32 |
90 | | #define TARGET_FORMAT "coff-go32" |
91 | | #endif |
92 | | #ifdef OBJ_AOUT |
93 | | #define TARGET_FORMAT AOUT_TARGET_FORMAT |
94 | | #endif |
95 | | #endif |
96 | | |
97 | 0 | #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 |
98 | | |
99 | | /* '$' may be used as immediate prefix. */ |
100 | | #undef LOCAL_LABELS_DOLLAR |
101 | 102k | #define LOCAL_LABELS_DOLLAR 0 |
102 | | #undef LOCAL_LABELS_FB |
103 | 138k | #define LOCAL_LABELS_FB 1 |
104 | | |
105 | | extern const char extra_symbol_chars[]; |
106 | 207 | #define tc_symbol_chars extra_symbol_chars |
107 | | |
108 | | extern const char *i386_comment_chars; |
109 | 3.77k | #define tc_comment_chars i386_comment_chars |
110 | | |
111 | | /* The name of the global offset table generated by the compiler. Allow |
112 | | this to be overridden if need be. */ |
113 | | #ifndef GLOBAL_OFFSET_TABLE_NAME |
114 | 1.36k | #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" |
115 | | #endif |
116 | | |
117 | 2.04k | #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) |
118 | | extern bfd_reloc_code_real_type x86_cons (expressionS *, int); |
119 | | |
120 | | #define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP, RELOC) \ |
121 | 2.49k | x86_cons_fix_new(FRAG, OFF, LEN, EXP, RELOC) |
122 | | extern void x86_cons_fix_new |
123 | | (fragS *, unsigned int, unsigned int, expressionS *, bfd_reloc_code_real_type); |
124 | | |
125 | 104 | #define X_PRECISION 5 |
126 | 108 | #define X_PRECISION_PAD 0 |
127 | | |
128 | 35 | #define TC_ADDRESS_BYTES x86_address_bytes |
129 | | extern int x86_address_bytes (void); |
130 | | |
131 | | #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ |
132 | | |
133 | 476k | #define NO_RELOC BFD_RELOC_NONE |
134 | | |
135 | | int i386_validate_fix (struct fix *); |
136 | 0 | #define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) do { \ |
137 | 0 | if (!i386_validate_fix(FIX)) goto SKIP; \ |
138 | 0 | } while (0) |
139 | | |
140 | | #ifdef OBJ_ELF |
141 | 0 | #define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) |
142 | | extern int tc_i386_fix_adjustable (struct fix *); |
143 | | #else |
144 | | #define md_undefined_symbol(N) ((void)(N), NULL) |
145 | | #endif |
146 | | |
147 | | /* Values passed to md_apply_fix don't include the symbol value. */ |
148 | 0 | #define MD_APPLY_SYM_VALUE(FIX) 0 |
149 | | |
150 | | /* ELF wants external syms kept, as does PE COFF. */ |
151 | | #if defined (TE_PE) && defined (STRICT_PE_FORMAT) |
152 | | #define EXTERN_FORCE_RELOC \ |
153 | | (IS_ELF || OUTPUT_FLAVOR == bfd_target_coff_flavour) |
154 | | #else |
155 | 0 | #define EXTERN_FORCE_RELOC IS_ELF |
156 | | #endif |
157 | | |
158 | | /* This expression evaluates to true if the relocation is for a local |
159 | | object for which we still want to do the relocation at runtime. |
160 | | False if we are willing to perform this relocation while building |
161 | | the .o file. GOTOFF and GOT32 do not need to be checked here because |
162 | | they are not pcrel. .*/ |
163 | | |
164 | | #define TC_FORCE_RELOCATION_LOCAL(FIX) \ |
165 | 0 | (GENERIC_FORCE_RELOCATION_LOCAL (FIX) \ |
166 | 0 | || (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \ |
167 | 0 | || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \ |
168 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCREL \ |
169 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCRELX \ |
170 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_REX_GOTPCRELX \ |
171 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_4_GOTPCRELX \ |
172 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_5_GOTPCRELX \ |
173 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_6_GOTPCRELX) |
174 | | |
175 | | #define TC_FORCE_RELOCATION_ABS(FIX) \ |
176 | 0 | (TC_FORCE_RELOCATION (FIX) \ |
177 | 0 | || (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \ |
178 | 0 | || (FIX)->fx_r_type == BFD_RELOC_386_GOT32X \ |
179 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCREL \ |
180 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCRELX \ |
181 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_REX_GOTPCRELX \ |
182 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_4_GOTPCRELX \ |
183 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_5_GOTPCRELX \ |
184 | 0 | || (FIX)->fx_r_type == BFD_RELOC_X86_64_CODE_6_GOTPCRELX) |
185 | | |
186 | | extern void i386_start_line (void); |
187 | 112k | #define md_start_line_hook i386_start_line |
188 | | |
189 | | extern bool i386_check_label (void); |
190 | | #define TC_START_LABEL(STR, NUL_CHAR, NEXT_CHAR) \ |
191 | 80.9k | (NEXT_CHAR == ':' && i386_check_label ()) |
192 | | |
193 | | extern int i386_unrecognized_line (int); |
194 | 11.7k | #define tc_unrecognized_line i386_unrecognized_line |
195 | | |
196 | | extern int i386_parse_name (char *, expressionS *, enum expr_mode, char *); |
197 | 16.1k | #define md_parse_name(s, e, m, c) i386_parse_name (s, e, m, c) |
198 | | |
199 | | extern operatorT i386_operator (const char *name, unsigned int operands, char *); |
200 | 79.0k | #define md_operator i386_operator |
201 | | |
202 | | extern int i386_need_index_operator (void); |
203 | 1.74k | #define md_need_index_operator i386_need_index_operator |
204 | | |
205 | | #ifdef BFD64 |
206 | | extern bool i386_record_operator |
207 | | (operatorT, const expressionS *, const expressionS *); |
208 | 62.2k | #define md_optimize_expr(l, o, r) i386_record_operator (o, l, r) |
209 | | #endif |
210 | | |
211 | 10.6k | #define md_register_arithmetic 0 |
212 | | |
213 | | extern const struct relax_type md_relax_table[]; |
214 | 0 | #define TC_GENERIC_RELAX_TABLE md_relax_table |
215 | | |
216 | | extern int optimize_align_code; |
217 | | |
218 | 243 | #define md_do_align(n, fill, len, max, around) \ |
219 | 243 | if ((n) \ |
220 | 243 | && !need_pass_2 \ |
221 | 243 | && optimize_align_code \ |
222 | 243 | && (!(fill) \ |
223 | 127 | || ((char)*(fill) == (char)0x90 && (len) == 1)) \ |
224 | 243 | && subseg_text_p (now_seg)) \ |
225 | 243 | { \ |
226 | 17 | frag_align_code ((n), (max)); \ |
227 | 17 | goto around; \ |
228 | 17 | } |
229 | | |
230 | | extern void i386_cons_align (int); |
231 | 9.07k | #define md_cons_align(nbytes) i386_cons_align (nbytes) |
232 | | |
233 | | #ifndef OBJ_AOUT |
234 | 0 | #define md_section_align(seg, value) ((void)(seg), (value)) |
235 | | #endif |
236 | | |
237 | | void i386_print_statistics (FILE *); |
238 | 0 | #define tc_print_statistics i386_print_statistics |
239 | | |
240 | | void i386_md_end (void); |
241 | 207 | #define md_end i386_md_end |
242 | | |
243 | | extern unsigned int i386_frag_max_var (fragS *); |
244 | 0 | #define md_frag_max_var i386_frag_max_var |
245 | | |
246 | | extern long i386_generic_table_relax_frag (segT, fragS *, long); |
247 | | #define md_generic_table_relax_frag(segment, fragP, stretch) \ |
248 | 0 | i386_generic_table_relax_frag (segment, fragP, stretch) |
249 | | |
250 | 7.18k | #define md_number_to_chars number_to_chars_littleendian |
251 | | |
252 | | enum processor_type |
253 | | { |
254 | | PROCESSOR_UNKNOWN, |
255 | | PROCESSOR_GENERIC32, |
256 | | PROCESSOR_GENERIC64, |
257 | | PROCESSOR_I386, |
258 | | PROCESSOR_I486, |
259 | | PROCESSOR_PENTIUM, |
260 | | PROCESSOR_I686, |
261 | | PROCESSOR_PENTIUMPRO, |
262 | | PROCESSOR_PENTIUM4, |
263 | | PROCESSOR_NOCONA, |
264 | | PROCESSOR_CORE, |
265 | | PROCESSOR_CORE2, |
266 | | PROCESSOR_COREI7, |
267 | | PROCESSOR_IAMCU, |
268 | | PROCESSOR_K6, |
269 | | PROCESSOR_ATHLON, |
270 | | PROCESSOR_K8, |
271 | | PROCESSOR_AMDFAM10, |
272 | | PROCESSOR_BD, |
273 | | PROCESSOR_ZNVER, |
274 | | PROCESSOR_BT, |
275 | | /* Keep this last. */ |
276 | | PROCESSOR_NONE |
277 | | }; |
278 | | |
279 | | /* We support four different modes. I386_FLAG_CODE variable is used to |
280 | | distinguish three of these. */ |
281 | | |
282 | | enum i386_flag_code { |
283 | | CODE_32BIT, |
284 | | CODE_16BIT, |
285 | | CODE_64BIT |
286 | | }; |
287 | | |
288 | | struct i386_segment_info { |
289 | | /* Type of previous "instruction", e.g. .byte or stand-alone prefix. */ |
290 | | struct last_insn { |
291 | | const char *file; |
292 | | const char *name; |
293 | | unsigned int line; |
294 | | enum last_insn_kind |
295 | | { |
296 | | last_insn_other = 0, |
297 | | last_insn_directive, |
298 | | last_insn_prefix |
299 | | } kind; |
300 | | } last_insn; |
301 | | subsegT subseg; |
302 | | struct i386_segment_info *next; |
303 | | }; |
304 | | |
305 | | #define TC_SEGMENT_INFO_TYPE struct i386_segment_info |
306 | | |
307 | | struct i386_tc_frag_data |
308 | | { |
309 | | union |
310 | | { |
311 | | fragS *padding_fragP; |
312 | | fragS *branch_fragP; |
313 | | } u; |
314 | | addressT padding_address; |
315 | | enum processor_type isa; |
316 | | enum processor_type tune; |
317 | | enum i386_flag_code code; |
318 | | unsigned int max_bytes; |
319 | | unsigned char length; |
320 | | unsigned char last_length; |
321 | | unsigned char max_prefix_length; |
322 | | unsigned char prefix_length; |
323 | | unsigned char default_prefix; |
324 | | unsigned char cmp_size; |
325 | | unsigned int mf_type : 3; |
326 | | unsigned int classified : 1; |
327 | | unsigned int branch_type : 3; |
328 | | unsigned int cpunop : 1; |
329 | | unsigned int isanop : 1; |
330 | | unsigned int last_insn_normal : 1; |
331 | | bool no_cond_jump_promotion : 1; |
332 | | }; |
333 | | |
334 | | /* We need to emit the right NOP pattern in .align frags. This is |
335 | | done after the text-to-bits assembly pass, so we need to mark it with |
336 | | the isa/tune settings at the time the .align was assembled. */ |
337 | | #define TC_FRAG_TYPE struct i386_tc_frag_data |
338 | | |
339 | | void i386_frag_init (fragS *, size_t); |
340 | 4.19k | #define TC_FRAG_INIT(fragP, max_bytes) i386_frag_init (fragP, max_bytes) |
341 | | |
342 | | #define WORKING_DOT_WORD 1 |
343 | | |
344 | | /* How to generate NOPs for .nop direct directive. */ |
345 | | extern void i386_generate_nops (fragS *, char *, offsetT, int); |
346 | | #define md_generate_nops(frag, where, amount, control) \ |
347 | 0 | i386_generate_nops ((frag), (where), (amount), (control)) |
348 | | |
349 | 0 | #define HANDLE_ALIGN(sec, fragP) \ |
350 | 0 | if (fragP->fr_type == rs_align_code) \ |
351 | 0 | { \ |
352 | 0 | offsetT __count = (fragP->fr_next->fr_address \ |
353 | 0 | - fragP->fr_address \ |
354 | 0 | - fragP->fr_fix); \ |
355 | 0 | if (__count > 0) \ |
356 | 0 | { \ |
357 | 0 | know (fragP->tc_frag_data.max_bytes >= (valueT) __count \ |
358 | 0 | || (fragP->tc_frag_data.max_bytes \ |
359 | 0 | >= MAX_MEM_FOR_RS_ALIGN_CODE (fragP->fr_offset, \ |
360 | 0 | fragP->fr_subtype))); \ |
361 | 0 | md_generate_nops (fragP, fragP->fr_literal + fragP->fr_fix, \ |
362 | 0 | __count, 0); \ |
363 | 0 | } \ |
364 | 0 | } |
365 | | /* Possible plain nop, branch, twice largest nop less 1. |
366 | | Yes, the branch might be one byte longer in CODE_16BIT but then the |
367 | | largest nop is smaller. */ |
368 | 83 | #define MAX_MEM_FOR_RS_SPACE_NOP (1 + 5 + 2 * 15 - 1) |
369 | | |
370 | | static inline unsigned int |
371 | | max_mem_for_rs_align_code (unsigned int p2align, unsigned int max) |
372 | 50 | { |
373 | 50 | unsigned int bytes = 1; |
374 | 50 | if (p2align != 0) |
375 | 50 | { |
376 | 50 | bytes = MAX_MEM_FOR_RS_SPACE_NOP; |
377 | 50 | if (bytes > (1ull << p2align) - 1) |
378 | 23 | bytes = (1ull << p2align) - 1; |
379 | 50 | if (max != 0 && bytes > max) |
380 | 0 | bytes = max; |
381 | 50 | } |
382 | 50 | return bytes; |
383 | 50 | } Unexecuted instantiation: fuzz_as.c:max_mem_for_rs_align_code Unexecuted instantiation: codeview.c:max_mem_for_rs_align_code Unexecuted instantiation: cond.c:max_mem_for_rs_align_code Unexecuted instantiation: depend.c:max_mem_for_rs_align_code Unexecuted instantiation: dw2gencfi.c:max_mem_for_rs_align_code Unexecuted instantiation: dwarf2dbg.c:max_mem_for_rs_align_code Unexecuted instantiation: ehopt.c:max_mem_for_rs_align_code Unexecuted instantiation: expr.c:max_mem_for_rs_align_code frags.c:max_mem_for_rs_align_code Line | Count | Source | 372 | 50 | { | 373 | 50 | unsigned int bytes = 1; | 374 | 50 | if (p2align != 0) | 375 | 50 | { | 376 | 50 | bytes = MAX_MEM_FOR_RS_SPACE_NOP; | 377 | 50 | if (bytes > (1ull << p2align) - 1) | 378 | 23 | bytes = (1ull << p2align) - 1; | 379 | 50 | if (max != 0 && bytes > max) | 380 | 0 | bytes = max; | 381 | 50 | } | 382 | 50 | return bytes; | 383 | 50 | } |
Unexecuted instantiation: gen-sframe.c:max_mem_for_rs_align_code Unexecuted instantiation: input-scrub.c:max_mem_for_rs_align_code Unexecuted instantiation: listing.c:max_mem_for_rs_align_code Unexecuted instantiation: macro.c:max_mem_for_rs_align_code Unexecuted instantiation: messages.c:max_mem_for_rs_align_code Unexecuted instantiation: output-file.c:max_mem_for_rs_align_code Unexecuted instantiation: read.c:max_mem_for_rs_align_code Unexecuted instantiation: remap.c:max_mem_for_rs_align_code Unexecuted instantiation: sb.c:max_mem_for_rs_align_code Unexecuted instantiation: scfidw2gen.c:max_mem_for_rs_align_code Unexecuted instantiation: stabs.c:max_mem_for_rs_align_code Unexecuted instantiation: subsegs.c:max_mem_for_rs_align_code Unexecuted instantiation: symbols.c:max_mem_for_rs_align_code Unexecuted instantiation: write.c:max_mem_for_rs_align_code Unexecuted instantiation: app.c:max_mem_for_rs_align_code Unexecuted instantiation: atof-generic.c:max_mem_for_rs_align_code Unexecuted instantiation: ecoff.c:max_mem_for_rs_align_code Unexecuted instantiation: flonum-copy.c:max_mem_for_rs_align_code Unexecuted instantiation: ginsn.c:max_mem_for_rs_align_code Unexecuted instantiation: hash.c:max_mem_for_rs_align_code Unexecuted instantiation: input-file.c:max_mem_for_rs_align_code Unexecuted instantiation: scfi.c:max_mem_for_rs_align_code Unexecuted instantiation: sframe-opt.c:max_mem_for_rs_align_code Unexecuted instantiation: tc-i386.c:max_mem_for_rs_align_code Unexecuted instantiation: obj-elf.c:max_mem_for_rs_align_code Unexecuted instantiation: atof-ieee.c:max_mem_for_rs_align_code |
384 | | #define MAX_MEM_FOR_RS_ALIGN_CODE(p2align, max) \ |
385 | 50 | max_mem_for_rs_align_code (p2align, max) |
386 | | |
387 | | /* We want .cfi_* pseudo-ops for generating unwind info. */ |
388 | | #define TARGET_USE_CFIPOP 1 |
389 | | |
390 | | extern unsigned int x86_dwarf2_return_column; |
391 | 42 | #define DWARF2_DEFAULT_RETURN_COLUMN x86_dwarf2_return_column |
392 | | |
393 | | extern int x86_cie_data_alignment; |
394 | 205 | #define DWARF2_CIE_DATA_ALIGNMENT x86_cie_data_alignment |
395 | | |
396 | | extern int x86_dwarf2_addr_size (void); |
397 | 23 | #define DWARF2_ADDR_SIZE(bfd) x86_dwarf2_addr_size () |
398 | | |
399 | 107 | #define tc_parse_to_dw2regnum tc_x86_parse_to_dw2regnum |
400 | | extern void tc_x86_parse_to_dw2regnum (expressionS *); |
401 | | |
402 | 39 | #define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions |
403 | | extern void tc_x86_frame_initial_instructions (void); |
404 | | |
405 | | /* DWARF register number of the frame-pointer register in 64-bit mode. */ |
406 | 0 | #define REG_FP 6 |
407 | | /* DWARF register number of the stack-pointer register in 64-bit mode. */ |
408 | 39 | #define REG_SP 7 |
409 | | /* DWARF register number of the (pseudo) return address register in 64-bit |
410 | | mode. This is the same as reg RIP in i386-reg.tbl. */ |
411 | 207 | #define REG_RA 16 |
412 | | |
413 | 0 | #define md_elf_section_type(str,len) i386_elf_section_type (str, len) |
414 | | extern int i386_elf_section_type (const char *, size_t); |
415 | | |
416 | 925 | #define md_elf_section_change_hook i386_elf_section_change_hook |
417 | | extern void i386_elf_section_change_hook (void); |
418 | | |
419 | | #ifdef TE_SOLARIS |
420 | | #define md_fix_up_eh_frame(sec) i386_solaris_fix_up_eh_frame (sec) |
421 | | extern void i386_solaris_fix_up_eh_frame (segT); |
422 | | #endif |
423 | | |
424 | | /* Support for SHF_X86_64_LARGE */ |
425 | | extern bfd_vma x86_64_section_letter (int, const char **); |
426 | 26 | #define md_elf_section_letter(LETTER, PTR_MSG) x86_64_section_letter (LETTER, PTR_MSG) |
427 | | |
428 | | #ifdef OBJ_ELF |
429 | | extern void x86_cleanup (void); |
430 | 207 | #define md_cleanup() x86_cleanup () |
431 | | |
432 | | #define TARGET_USE_GINSN 1 |
433 | | /* Allow GAS to synthesize DWARF CFI for hand-written asm. |
434 | | PS: TARGET_USE_CFIPOP is a pre-condition. */ |
435 | | #define TARGET_USE_SCFI 1 |
436 | | /* Identify the maximum DWARF register number of all the registers being |
437 | | tracked for SCFI. This is the last DWARF register number of the set |
438 | | of SP, BP, and all callee-saved registers. For AMD64, this means |
439 | | R15 (15). Use SCFI_CALLEE_SAVED_REG_P to identify which registers |
440 | | are callee-saved from this set. */ |
441 | 0 | #define SCFI_MAX_REG_ID 15 |
442 | | /* Some ABIs, like AMD64, use stack for call instruction. For such an ABI, |
443 | | identify the initial (CFA) offset from RSP at the entry of function. */ |
444 | 0 | #define SCFI_INIT_CFA_OFFSET 8 |
445 | | |
446 | 0 | #define SCFI_CALLEE_SAVED_REG_P(dw2reg) x86_scfi_callee_saved_p (dw2reg) |
447 | | extern bool x86_scfi_callee_saved_p (uint32_t dw2reg_num); |
448 | | |
449 | | /* Whether SFrame stack trace info is supported. */ |
450 | | extern bool x86_support_sframe_p (void); |
451 | 3 | #define support_sframe_p x86_support_sframe_p |
452 | | |
453 | | /* The stack pointer DWARF register number for SFrame CFA tracking. */ |
454 | | extern const unsigned int x86_sframe_cfa_sp_reg; |
455 | 11 | #define SFRAME_CFA_SP_REG x86_sframe_cfa_sp_reg |
456 | | |
457 | | /* The frame pointer DWARF register number for SFrame CFA and FP tracking. */ |
458 | | extern const unsigned int x86_sframe_cfa_fp_reg; |
459 | 18 | #define SFRAME_CFA_FP_REG x86_sframe_cfa_fp_reg |
460 | | |
461 | | /* The return address DWARF register number for SFrame purposes. Although for |
462 | | AMD64, RA tracking is disabled, specific constructs, like for indicating |
463 | | the _start function, may use it. */ |
464 | | extern const unsigned int x86_sframe_cfa_ra_reg; |
465 | 15 | #define SFRAME_CFA_RA_REG x86_sframe_cfa_ra_reg |
466 | | |
467 | | /* Whether SFrame return address tracking is needed. |
468 | | In AMD64, return address is always stored on the stack at a fixed offset |
469 | | from the CFA (provided via x86_sframe_cfa_ra_offset ()). Do not track |
470 | | explicitly via the data words in the SFrame Frame Row Entry. */ |
471 | 29 | #define sframe_ra_tracking_p() false |
472 | | |
473 | | /* The fixed offset from CFA for SFrame to recover the return address. |
474 | | (useful only when SFrame RA tracking is not needed). */ |
475 | | extern offsetT x86_sframe_cfa_ra_offset (void); |
476 | 6 | #define sframe_cfa_ra_offset x86_sframe_cfa_ra_offset |
477 | | |
478 | | /* The abi/arch identifier for SFrame. */ |
479 | | extern unsigned char x86_sframe_get_abi_arch (void); |
480 | 11 | #define sframe_get_abi_arch x86_sframe_get_abi_arch |
481 | | |
482 | | /* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ |
483 | 13 | #define sframe_support_flex_fde_p() true |
484 | | |
485 | | #endif |
486 | | |
487 | | #ifdef TE_PE |
488 | | |
489 | | #define O_secrel O_md1 |
490 | | |
491 | | #define TC_DWARF2_EMIT_OFFSET tc_pe_dwarf2_emit_offset |
492 | | void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int); |
493 | | |
494 | | #endif /* TE_PE */ |
495 | | |
496 | | /* X_add_symbol:X_op_symbol (Intel mode only) */ |
497 | 0 | #define O_full_ptr O_md2 |
498 | | |
499 | | #ifdef OBJ_MACH_O |
500 | | |
501 | | #define TC_FORCE_RELOCATION(FIX) (obj_mach_o_force_reloc (FIX)) |
502 | | |
503 | | #define TC_FORCE_RELOCATION_SUB_SAME(FIX,SEG) \ |
504 | | (obj_mach_o_force_reloc_sub_same (FIX, SEG)) |
505 | | |
506 | | #define TC_FORCE_RELOCATION_SUB_LOCAL(FIX,SEG) \ |
507 | | (obj_mach_o_force_reloc_sub_local (FIX, SEG)) |
508 | | |
509 | | #define TC_VALIDATE_FIX_SUB(FIX, SEG) 1 |
510 | | |
511 | | #endif /* OBJ_MACH_O */ |
512 | | |
513 | | #endif /* TC_I386 */ |