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