You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 line
4.7KB

  1. /* Definitions of target machine for GNU compiler.
  2. For ARM with ELF obj format.
  3. Copyright (C) 1995-2020 Free Software Foundation, Inc.
  4. Contributed by Philip Blundell <philb@gnu.org> and
  5. Catherine Moore <clm@cygnus.com>
  6. This file is part of GCC.
  7. GCC is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published
  9. by the Free Software Foundation; either version 3, or (at your
  10. option) any later version.
  11. GCC is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  13. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  14. License for more details.
  15. Under Section 7 of GPL version 3, you are granted additional
  16. permissions described in the GCC Runtime Library Exception, version
  17. 3.1, as published by the Free Software Foundation.
  18. You should have received a copy of the GNU General Public License and
  19. a copy of the GCC Runtime Library Exception along with this program;
  20. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  21. <http://www.gnu.org/licenses/>. */
  22. #ifndef OBJECT_FORMAT_ELF
  23. #error elf.h included before elfos.h
  24. #endif
  25. #ifndef LOCAL_LABEL_PREFIX
  26. #define LOCAL_LABEL_PREFIX "."
  27. #endif
  28. #ifndef SUBTARGET_CPP_SPEC
  29. #define SUBTARGET_CPP_SPEC "-D__ELF__"
  30. #endif
  31. #ifndef SUBTARGET_EXTRA_SPECS
  32. #define SUBTARGET_EXTRA_SPECS \
  33. { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
  34. { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
  35. SUBSUBTARGET_EXTRA_SPECS
  36. #endif
  37. #ifndef SUBTARGET_EXTRA_ASM_SPEC
  38. #define SUBTARGET_EXTRA_ASM_SPEC ""
  39. #endif
  40. #ifndef SUBTARGET_ASM_FLOAT_SPEC
  41. #define SUBTARGET_ASM_FLOAT_SPEC "\
  42. %{mapcs-float:-mfloat}"
  43. #endif
  44. #undef SUBSUBTARGET_EXTRA_SPECS
  45. #define SUBSUBTARGET_EXTRA_SPECS
  46. #ifndef ASM_SPEC
  47. #define ASM_SPEC "\
  48. %{mbig-endian:-EB} \
  49. %{mlittle-endian:-EL} \
  50. %(asm_cpu_spec) \
  51. %{mapcs-*:-mapcs-%*} \
  52. %(subtarget_asm_float_spec) \
  53. %{mthumb-interwork:-mthumb-interwork} \
  54. %{mfloat-abi=*} %{!mfpu=auto: %{mfpu=*}} \
  55. %(subtarget_extra_asm_spec)"
  56. #endif
  57. /* The ARM uses @ are a comment character so we need to redefine
  58. TYPE_OPERAND_FMT. */
  59. #undef TYPE_OPERAND_FMT
  60. #define TYPE_OPERAND_FMT "%%%s"
  61. /* We might need a ARM specific header to function declarations. */
  62. #undef ASM_DECLARE_FUNCTION_NAME
  63. #define ASM_DECLARE_FUNCTION_NAME arm_asm_declare_function_name
  64. /* We might need an ARM specific trailer for function declarations. */
  65. #undef ASM_DECLARE_FUNCTION_SIZE
  66. #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
  67. do \
  68. { \
  69. ARM_OUTPUT_FN_UNWIND (FILE, FALSE); \
  70. if (!flag_inhibit_size_directive) \
  71. ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
  72. } \
  73. while (0)
  74. /* Define this macro if jump tables (for `tablejump' insns) should be
  75. output in the text section, along with the assembler instructions.
  76. Otherwise, the readonly data section is used. */
  77. /* We put ARM and Thumb-2 jump tables in the text section, because it makes
  78. the code more efficient, but for Thumb-1 it's better to put them out of
  79. band unless we are generating compressed tables. */
  80. #define JUMP_TABLES_IN_TEXT_SECTION \
  81. ((TARGET_32BIT || (TARGET_THUMB && (optimize_size || flag_pic))) \
  82. && !target_pure_code)
  83. #ifndef LINK_SPEC
  84. #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
  85. #endif
  86. /* Run-time Target Specification. */
  87. #ifndef TARGET_DEFAULT
  88. #define TARGET_DEFAULT (MASK_APCS_FRAME)
  89. #endif
  90. #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
  91. /* Output an element in the static constructor array. */
  92. #undef TARGET_ASM_CONSTRUCTOR
  93. #define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor
  94. #undef TARGET_ASM_DESTRUCTOR
  95. #define TARGET_ASM_DESTRUCTOR arm_elf_asm_destructor
  96. /* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */
  97. #define NEED_PLT_RELOC flag_pic
  98. #define NEED_GOT_RELOC flag_pic
  99. /* The ELF assembler handles GOT addressing differently to NetBSD. */
  100. #define GOT_PCREL 0
  101. /* Align output to a power of two. Note ".align 0" is redundant,
  102. and also GAS will treat it as ".align 2" which we do not want. */
  103. #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
  104. do \
  105. { \
  106. if ((POWER) > 0) \
  107. fprintf (STREAM, "\t.align\t%d\n", POWER); \
  108. } \
  109. while (0)
  110. /* Horrible hack: We want to prevent some libgcc routines being included
  111. for some multilibs. The condition should match the one in
  112. libgcc/config/arm/lib1funcs.S and libgcc/config/arm/t-elf. */
  113. #if __ARM_ARCH_ISA_ARM || __ARM_ARCH_ISA_THUMB != 1
  114. #undef L_fixdfsi
  115. #undef L_fixunsdfsi
  116. #undef L_truncdfsf2
  117. #undef L_fixsfsi
  118. #undef L_fixunssfsi
  119. #undef L_floatdidf
  120. #undef L_floatdisf
  121. #undef L_floatundidf
  122. #undef L_floatundisf
  123. #endif