tc-ft32.h 2.7 KB

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