tc-microblaze.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* tc-microblaze.h -- Header file for tc-microblaze.c.
  2. Copyright (C) 2009-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 the Free
  14. Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
  15. 02110-1301, USA. */
  16. #ifndef TC_MICROBLAZE
  17. #define TC_MICROBLAZE 1
  18. #define TARGET_ARCH bfd_arch_microblaze
  19. #ifndef TARGET_BYTES_BIG_ENDIAN
  20. /* Used to initialise target_big_endian. */
  21. #define TARGET_BYTES_BIG_ENDIAN 1
  22. #endif
  23. #define IGNORE_NONSTANDARD_ESCAPES
  24. #define TC_RELOC_MANGLE(a,b,c) tc_reloc_mangle (a, b, c)
  25. /* We need to handle expressions of type "symbol op symbol" and create
  26. relocs for such expressions as -relax in linker can change the value
  27. of such expressions */
  28. #define TC_CONS_FIX_NEW cons_fix_new_microblaze
  29. #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
  30. parse_cons_expression_microblaze (EXP, NBYTES)
  31. extern bfd_reloc_code_real_type parse_cons_expression_microblaze
  32. (expressionS *, int);
  33. #define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) 1
  34. #define UNDEFINED_DIFFERENCE_OK 1
  35. #define TC_FORCE_RELOCATION_LOCAL(FIX) \
  36. (!(FIX)->fx_pcrel \
  37. || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOT \
  38. || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_PLT \
  39. || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOTOFF \
  40. || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_32_GOTOFF \
  41. || TC_FORCE_RELOCATION (FIX))
  42. #define tc_fix_adjustable(X) tc_microblaze_fix_adjustable(X)
  43. extern int tc_microblaze_fix_adjustable (struct fix *);
  44. extern const struct relax_type md_relax_table[];
  45. #define TC_GENERIC_RELAX_TABLE md_relax_table
  46. /* We don't need to handle .word strangely. */
  47. #define WORKING_DOT_WORD
  48. #define LISTING_HEADER "Xilinx MicroBlaze GAS Listing"
  49. #define LISTING_LHS_CONT_LINES 4
  50. #define NEED_FX_R_TYPE 1
  51. /* We want local label support. */
  52. #define LOCAL_LABELS_FB 1
  53. /* Want the section information too... */
  54. #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
  55. #define MD_APPLY_FIX3 /* We want the segment as well. */
  56. /* We set the fx_done field appropriately in md_apply_fix. */
  57. #define TC_HANDLES_FX_DONE
  58. #ifdef OBJ_ELF
  59. #define TARGET_FORMAT (target_big_endian ? "elf32-microblaze" : "elf32-microblazeel")
  60. #define ELF_TC_SPECIAL_SECTIONS \
  61. { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
  62. { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \
  63. { ".sdata2", SHT_PROGBITS, SHF_ALLOC }, \
  64. { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \
  65. /* Other special sections not generated by the assembler: .reginfo,
  66. .liblist, .conflict, .gptab, .got, .dynamic, .rel.dyn. */
  67. #endif /* OBJ_ELF */
  68. #ifndef TARGET_FORMAT
  69. # error No target format specified.
  70. #endif
  71. #include "write.h" /* For definition of fixS */
  72. extern void md_begin (void);
  73. extern void md_assemble (char *);
  74. extern symbolS * md_undefined_symbol (char *);
  75. extern char * md_atof (int, char *, int *);
  76. extern int md_parse_option (int, char *);
  77. extern void md_show_usage (FILE *);
  78. extern void md_convert_frag (bfd *, segT, fragS *);
  79. extern void md_operand (expressionS *);
  80. extern int md_estimate_size_before_relax (fragS *, segT);
  81. extern void md_number_to_chars (char *, valueT, int);
  82. extern valueT md_section_align (segT, valueT);
  83. extern long md_pcrel_from_section (fixS *, segT);
  84. extern arelent * tc_gen_reloc (asection *, fixS *);
  85. extern void cons_fix_new_microblaze (fragS *, int, int,
  86. expressionS *,
  87. bfd_reloc_code_real_type);
  88. extern void md_apply_fix3 (fixS *, valueT *, segT);
  89. #define EXTERN_FORCE_RELOC -1
  90. #endif /* TC_MICROBLAZE */