sysv4.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* Override definitions in elfos.h to be correct for IA64.
  2. Copyright (C) 2000-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #undef TARGET_INIT_LIBFUNCS
  20. #define TARGET_INIT_LIBFUNCS ia64_sysv4_init_libfuncs
  21. /* We want DWARF2 as specified by the IA64 ABI. */
  22. #undef PREFERRED_DEBUGGING_TYPE
  23. #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
  24. /* Stabs does not work properly for 64-bit targets. */
  25. #undef DBX_DEBUGGING_INFO
  26. /* Various pseudo-ops for which the Intel assembler uses non-standard
  27. definitions. */
  28. #undef STRING_ASM_OP
  29. #define STRING_ASM_OP "\tstringz\t"
  30. #undef SKIP_ASM_OP
  31. #define SKIP_ASM_OP "\t.skip\t"
  32. #undef COMMON_ASM_OP
  33. #define COMMON_ASM_OP "\t.common\t"
  34. #undef ASCII_DATA_ASM_OP
  35. #define ASCII_DATA_ASM_OP "\tstring\t"
  36. /* ia64-specific options for gas
  37. ??? ia64 gas doesn't accept standard svr4 assembler options? */
  38. #undef ASM_SPEC
  39. #define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic} %(asm_extra)"
  40. /* ??? Unfortunately, .lcomm doesn't work, because it puts things in either
  41. .bss or .sbss, and we can't control the decision of which is used. When
  42. I use .lcomm, I get a cryptic "Section group has no member" error from
  43. the Intel simulator. So we must explicitly put variables in .bss
  44. instead. This matters only if we care about the Intel assembler. */
  45. /* This is asm_output_aligned_bss from varasm.c without the
  46. (*targetm.asm_out.globalize_label) call at the beginning. */
  47. /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME. */
  48. extern int size_directive_output;
  49. #undef ASM_OUTPUT_ALIGNED_LOCAL
  50. #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
  51. do { \
  52. if ((DECL) && sdata_symbolic_operand (XEXP (DECL_RTL (DECL), 0), Pmode)) \
  53. switch_to_section (sbss_section); \
  54. else \
  55. switch_to_section (bss_section); \
  56. ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
  57. ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
  58. ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
  59. } while (0)
  60. /* The # tells the Intel assembler that this is not a register name.
  61. However, we can't emit the # in a label definition, so we set a variable
  62. in ASM_OUTPUT_LABEL to control whether we want the postfix here or not.
  63. We append the # to the label name, but since NAME can be an expression
  64. we have to scan it for a non-label character and insert the # there. */
  65. #undef ASM_OUTPUT_LABELREF
  66. #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
  67. do { \
  68. const char *name_ = NAME; \
  69. if (*name_ == '*') \
  70. name_++; \
  71. else \
  72. fputs (user_label_prefix, STREAM); \
  73. fputs (name_, STREAM); \
  74. if (!ia64_asm_output_label) \
  75. fputc ('#', STREAM); \
  76. } while (0)
  77. /* Intel assembler requires both flags and type if declaring a non-predefined
  78. section. */
  79. #undef INIT_SECTION_ASM_OP
  80. #define INIT_SECTION_ASM_OP "\t.section\t.init,\"ax\",\"progbits\""
  81. #undef FINI_SECTION_ASM_OP
  82. #define FINI_SECTION_ASM_OP "\t.section\t.fini,\"ax\",\"progbits\""
  83. #define DBX_REGISTER_NUMBER(REGNO) \
  84. ia64_dbx_register_number(REGNO)
  85. #undef SIZE_TYPE
  86. #define SIZE_TYPE "long unsigned int"
  87. #undef PTRDIFF_TYPE
  88. #define PTRDIFF_TYPE "long int"
  89. #undef WCHAR_TYPE
  90. #define WCHAR_TYPE "int"
  91. #undef WCHAR_TYPE_SIZE
  92. #define WCHAR_TYPE_SIZE 32
  93. /* We redefine this to use the ia64 .proc pseudo-op. */
  94. #undef ASM_DECLARE_FUNCTION_NAME
  95. #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
  96. ia64_start_function(FILE,NAME,DECL)
  97. /* We redefine this to use the ia64 .endp pseudo-op. */
  98. #undef ASM_DECLARE_FUNCTION_SIZE
  99. #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
  100. do { \
  101. fputs ("\t.endp ", FILE); \
  102. assemble_name (FILE, NAME); \
  103. fputc ('\n', FILE); \
  104. } while (0)
  105. /* Override default elf definition. */
  106. #undef TARGET_ASM_RELOC_RW_MASK
  107. #define TARGET_ASM_RELOC_RW_MASK ia64_reloc_rw_mask
  108. #undef TARGET_ASM_SELECT_RTX_SECTION
  109. #define TARGET_ASM_SELECT_RTX_SECTION ia64_select_rtx_section
  110. #define SDATA_SECTION_ASM_OP "\t.sdata"
  111. #define SBSS_SECTION_ASM_OP "\t.sbss"