tc-m32r.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* tc-m32r.h -- Header file for tc-m32r.c.
  2. Copyright (C) 1996-2015 Free Software Foundation, Inc.
  3. This file is part of GAS, the GNU Assembler.
  4. GAS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GAS is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GAS; see the file COPYING. If not, write to
  14. the Free Software Foundation, 51 Franklin Street - Fifth Floor,
  15. Boston, MA 02110-1301, USA. */
  16. #define TC_M32R
  17. #define LISTING_HEADER \
  18. (target_big_endian ? "M32R GAS" : "M32R GAS Little Endian")
  19. /* The target BFD architecture. */
  20. #define TARGET_ARCH bfd_arch_m32r
  21. /* The endianness of the target format may change based on command
  22. line arguments. */
  23. #define TARGET_FORMAT m32r_target_format()
  24. extern const char *m32r_target_format (void);
  25. /* Default to big endian. */
  26. #ifndef TARGET_BYTES_BIG_ENDIAN
  27. #define TARGET_BYTES_BIG_ENDIAN 1
  28. #endif
  29. /* Call md_pcrel_from_section, not md_pcrel_from. */
  30. long md_pcrel_from_section (struct fix *, segT);
  31. #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC)
  32. /* Permit temporary numeric labels. */
  33. #define LOCAL_LABELS_FB 1
  34. #define DIFF_EXPR_OK /* .-foo gets turned into PC relative relocs. */
  35. /* We don't need to handle .word strangely. */
  36. #define WORKING_DOT_WORD
  37. /* For 8 vs 16 vs 32 bit branch selection. */
  38. extern const struct relax_type md_relax_table[];
  39. #define TC_GENERIC_RELAX_TABLE md_relax_table
  40. extern long m32r_relax_frag (segT, fragS *, long);
  41. #define md_relax_frag(segment, fragP, stretch) \
  42. m32r_relax_frag (segment, fragP, stretch)
  43. /* Account for nop if 32 bit insn falls on odd halfword boundary. */
  44. #define TC_CGEN_MAX_RELAX(insn, len) 6
  45. /* Fill in rs_align_code fragments. */
  46. extern void m32r_handle_align (fragS *);
  47. #define HANDLE_ALIGN(f) m32r_handle_align (f)
  48. #define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2 + 4)
  49. /* Values passed to md_apply_fix don't include the symbol value. */
  50. #define MD_APPLY_SYM_VALUE(FIX) 0
  51. #define md_apply_fix gas_cgen_md_apply_fix
  52. #define tc_fix_adjustable(FIX) m32r_fix_adjustable (FIX)
  53. bfd_boolean m32r_fix_adjustable (struct fix *);
  54. /* After creating a fixup for an instruction operand, we need to check for
  55. HI16 relocs and queue them up for later sorting. */
  56. #define md_cgen_record_fixup_exp m32r_cgen_record_fixup_exp
  57. #define TC_HANDLES_FX_DONE
  58. extern int pic_code;
  59. extern bfd_boolean m32r_fix_adjustable (struct fix *);
  60. /* This arranges for gas/write.c to not apply a relocation if
  61. obj_fix_adjustable() says it is not adjustable. */
  62. #define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
  63. #define tc_frob_file_before_fix() m32r_frob_file ()
  64. extern void m32r_frob_file (void);
  65. /* No shared lib support, so we don't need to ensure externally
  66. visible symbols can be overridden.
  67. #define EXTERN_FORCE_RELOC 0 */
  68. /* When relaxing, we need to emit various relocs we otherwise wouldn't. */
  69. #define TC_FORCE_RELOCATION(fix) m32r_force_relocation (fix)
  70. extern int m32r_force_relocation (struct fix *);
  71. /* Ensure insns at labels are aligned to 32 bit boundaries. */
  72. int m32r_fill_insn (int);
  73. #define TC_START_LABEL(STR, NUL_CHAR, NEXT_CHAR) \
  74. (NEXT_CHAR == ':' && m32r_fill_insn (0))
  75. #define md_cleanup() m32r_fill_insn (1)
  76. #define md_elf_section_change_hook m32r_elf_section_change_hook
  77. extern void m32r_elf_section_change_hook (void);
  78. #define md_flush_pending_output() m32r_flush_pending_output ()
  79. extern void m32r_flush_pending_output (void);
  80. #define elf_tc_final_processing m32r_elf_final_processing
  81. extern void m32r_elf_final_processing (void);
  82. #define md_parse_name(name, exprP, mode, nextcharP) \
  83. m32r_parse_name ((name), (exprP), (mode), (nextcharP))
  84. extern int m32r_parse_name (char const *, expressionS *, enum expr_mode, char *);
  85. /* This is used to construct expressions out of @GOTOFF, @PLT and @GOT
  86. symbols. The relocation type is stored in X_md. */
  87. #define O_PIC_reloc O_md1
  88. #define TC_CGEN_PARSE_FIX_EXP(opinfo, exp) \
  89. m32r_cgen_parse_fix_exp(opinfo, exp)
  90. extern int m32r_cgen_parse_fix_exp (int, expressionS *);