1*1424dfb3Schristos /* tc-ft32.h -- Header file for tc-ft32.c. 2*1424dfb3Schristos 3*1424dfb3Schristos Copyright (C) 2013-2020 Free Software Foundation, Inc. 4*1424dfb3Schristos Contributed by FTDI (support@ftdichip.com) 5*1424dfb3Schristos 6*1424dfb3Schristos This file is part of GAS, the GNU Assembler. 7*1424dfb3Schristos 8*1424dfb3Schristos GAS is free software; you can redistribute it and/or modify 9*1424dfb3Schristos it under the terms of the GNU General Public License as published by 10*1424dfb3Schristos the Free Software Foundation; either version 3, or (at your option) 11*1424dfb3Schristos any later version. 12*1424dfb3Schristos 13*1424dfb3Schristos GAS is distributed in the hope that it will be useful, 14*1424dfb3Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 15*1424dfb3Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16*1424dfb3Schristos GNU General Public License for more details. 17*1424dfb3Schristos 18*1424dfb3Schristos You should have received a copy of the GNU General Public License along 19*1424dfb3Schristos with GAS; see the file COPYING. If not, write to the Free Software 20*1424dfb3Schristos Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 21*1424dfb3Schristos 22*1424dfb3Schristos #define TC_FT32 1 23*1424dfb3Schristos #define TARGET_BYTES_BIG_ENDIAN 0 24*1424dfb3Schristos #define WORKING_DOT_WORD 25*1424dfb3Schristos 26*1424dfb3Schristos /* This macro is the BFD architecture to pass to `bfd_set_arch_mach'. */ 27*1424dfb3Schristos #define TARGET_FORMAT "elf32-ft32" 28*1424dfb3Schristos 29*1424dfb3Schristos #define TARGET_ARCH bfd_arch_ft32 30*1424dfb3Schristos 31*1424dfb3Schristos #define md_undefined_symbol(NAME) 0 32*1424dfb3Schristos 33*1424dfb3Schristos /* These macros must be defined, but is will be a fatal assembler 34*1424dfb3Schristos error if we ever hit them. */ 35*1424dfb3Schristos #define md_estimate_size_before_relax(A, B) (as_fatal (_("estimate size\n")), 0) 36*1424dfb3Schristos #define md_convert_frag(B, S, F) (as_fatal (_("convert_frag\n"))) 37*1424dfb3Schristos 38*1424dfb3Schristos /* PC relative operands are relative to the start of the opcode, and 39*1424dfb3Schristos the operand is always one byte into the opcode. */ 40*1424dfb3Schristos #define md_pcrel_from(FIX) \ 41*1424dfb3Schristos ((FIX)->fx_where + (FIX)->fx_frag->fr_address - 1) 42*1424dfb3Schristos 43*1424dfb3Schristos #define md_section_align(SEGMENT, SIZE) (SIZE) 44*1424dfb3Schristos 45*1424dfb3Schristos /* If this macro returns non-zero, it guarantees that a relocation will be emitted 46*1424dfb3Schristos even when the value can be resolved locally. Do that if linkrelax is turned on */ 47*1424dfb3Schristos #define TC_FORCE_RELOCATION(fix) ft32_force_relocation (fix) 48*1424dfb3Schristos #define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \ 49*1424dfb3Schristos (! SEG_NORMAL (seg) || ft32_force_relocation (fix)) 50*1424dfb3Schristos extern int ft32_force_relocation (struct fix *); 51*1424dfb3Schristos 52*1424dfb3Schristos #define TC_LINKRELAX_FIXUP(seg) \ 53*1424dfb3Schristos ((seg->flags & SEC_CODE) || (seg->flags & SEC_DEBUGGING)) 54*1424dfb3Schristos 55*1424dfb3Schristos /* This macro is evaluated for any fixup with a fx_subsy that 56*1424dfb3Schristos fixup_segment cannot reduce to a number. If the macro returns 57*1424dfb3Schristos false an error will be reported. */ 58*1424dfb3Schristos #define TC_VALIDATE_FIX_SUB(fix, seg) ft32_validate_fix_sub (fix) 59*1424dfb3Schristos extern int ft32_validate_fix_sub (struct fix *); 60*1424dfb3Schristos 61*1424dfb3Schristos /* The difference between same-section symbols may be affected by linker 62*1424dfb3Schristos relaxation, so do not resolve such expressions in the assembler. */ 63*1424dfb3Schristos #define md_allow_local_subtract(l,r,s) ft32_allow_local_subtract (l, r, s) 64*1424dfb3Schristos extern bfd_boolean ft32_allow_local_subtract (expressionS *, 65*1424dfb3Schristos expressionS *, 66*1424dfb3Schristos segT); 67*1424dfb3Schristos 68*1424dfb3Schristos #define md_operand(x) 69