]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/ia64/sysv4.h
1 /* Override definitions in elfos.h/svr4.h to be correct for IA64. */
3 /* We want DWARF2 as specified by the IA64 ABI. */
4 #undef PREFERRED_DEBUGGING_TYPE
5 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
7 /* Various pseudo-ops for which the Intel assembler uses non-standard
11 #define ASM_BYTE_OP "data1"
14 #define STRING_ASM_OP "stringz"
17 #define SKIP_ASM_OP ".skip"
20 #define COMMON_ASM_OP ".common"
22 #undef ASCII_DATA_ASM_OP
23 #define ASCII_DATA_ASM_OP "string"
25 /* ??? Unfortunately, .lcomm doesn't work, because it puts things in either
26 .bss or .sbss, and we can't control the decision of which is used. When
27 I use .lcomm, I get a cryptic "Section group has no member" error from
28 the Intel simulator. So we must explicitly put variables in .bss
29 instead. This matters only if we care about the Intel assembler. */
31 /* This is asm_output_aligned_bss from varasm.c without the ASM_GLOBALIZE_LABEL
32 call at the beginning. */
34 /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME. */
35 extern int size_directive_output
;
37 #undef ASM_OUTPUT_ALIGNED_LOCAL
38 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
40 if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] == SDATA_NAME_FLAG_CHAR) \
44 ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
45 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
46 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
49 /* ??? Intel assembler does not allow "." in section names, so turn off
50 gnu.linkonce section support, but only when using the Intel assembler. */
51 #undef UNIQUE_SECTION_P
52 #define UNIQUE_SECTION_P(DECL) (TARGET_GNU_AS ? DECL_ONE_ONLY (DECL) : 0)
54 /* The # tells the Intel assembler that this is not a register name.
55 However, we can't emit the # in a label definition, so we set a variable
56 in ASM_OUTPUT_LABEL to control whether we want the postfix here or not. */
58 #undef ASM_OUTPUT_LABELREF
59 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
62 const char *real_name; \
63 STRIP_NAME_ENCODING (real_name, NAME); \
64 asm_fprintf (STREAM, "%U%s%s", real_name, \
65 (ia64_asm_output_label ? "" : "#")); \
69 /* Intel assembler requires both flags and type if declaring a non-predefined
71 #undef INIT_SECTION_ASM_OP
72 #define INIT_SECTION_ASM_OP ".section\t.init,\"ax\",\"progbits\""
73 #undef FINI_SECTION_ASM_OP
74 #define FINI_SECTION_ASM_OP ".section\t.fini,\"ax\",\"progbits\""
75 #undef CTORS_SECTION_ASM_OP
76 #define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\",\"progbits\""
77 #undef DTORS_SECTION_ASM_OP
78 #define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\",\"progbits\""
80 /* A C statement (sans semicolon) to output an element in the table of
81 global constructors. */
82 /* Must override this to get @fptr relocation. */
83 #undef ASM_OUTPUT_CONSTRUCTOR
84 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
87 if (TARGET_NO_PIC || TARGET_AUTO_PIC) \
88 fputs ("\tdata8\t ", FILE); \
90 fputs ("\tdata8\t @fptr(", FILE); \
91 assemble_name (FILE, NAME); \
92 if (TARGET_NO_PIC || TARGET_AUTO_PIC) \
95 fputs (")\n", FILE); \
98 /* A C statement (sans semicolon) to output an element in the table of
99 global destructors. */
100 /* Must override this to get @fptr relocation. */
101 #undef ASM_OUTPUT_DESTRUCTOR
102 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
105 if (TARGET_NO_PIC || TARGET_AUTO_PIC) \
106 fputs ("\tdata8\t ", FILE); \
108 fputs ("\tdata8\t @fptr(", FILE); \
109 assemble_name (FILE, NAME); \
110 if (TARGET_NO_PIC || TARGET_AUTO_PIC) \
111 fputs ("\n", FILE); \
113 fputs (")\n", FILE); \
116 /* svr4.h undefines this, so we need to define it here. */
117 #define DBX_REGISTER_NUMBER(REGNO) \
118 (IN_REGNO_P (REGNO) ? (32 + (REGNO) - IN_REG (0)) \
119 : LOC_REGNO_P (REGNO) ? (32 + ia64_input_regs + \
120 (REGNO) - LOC_REG (0)) \
121 : OUT_REGNO_P (REGNO) ? (32 + ia64_input_regs + ia64_local_regs \
122 + (REGNO) - OUT_REG (0)) \
123 : (REGNO) == FRAME_POINTER_REGNUM ? ia64_fp_regno \
126 /* Things that svr4.h defines to the wrong type, because it assumes 32 bit
127 ints and 32 bit longs. */
130 #define SIZE_TYPE "long unsigned int"
133 #define PTRDIFF_TYPE "long int"
136 #define WCHAR_TYPE "int"
138 #undef WCHAR_TYPE_SIZE
139 #define WCHAR_TYPE_SIZE 32
141 /* We don't want any symbol at the beginning of the file. This is defined in
142 dbxelf.h which is included from elfos.h, so we need to undef/define it
145 #undef ASM_IDENTIFY_GCC
146 #define ASM_IDENTIFY_GCC(FILE)
148 /* We redefine this to use the ia64 .proc pseudo-op. */
150 #undef ASM_DECLARE_FUNCTION_NAME
151 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
153 fputs ("\t.proc ", FILE); \
154 assemble_name (FILE, NAME); \
155 fputc ('\n', FILE); \
156 ASM_OUTPUT_LABEL (FILE, NAME); \
159 /* We redefine this to use the ia64 .endp pseudo-op. */
161 #undef ASM_DECLARE_FUNCTION_SIZE
162 #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
164 fputs ("\t.endp ", FILE); \
165 assemble_name (FILE, NAME); \
166 fputc ('\n', FILE); \
169 /* A C expression which outputs to the stdio stream STREAM some appropriate
170 text to go at the start of an assembler file. */
172 /* ??? Looks like almost every port, except for a few original ones, get this
173 wrong. Must emit #NO_APP as first line of file to turn of special assembler
174 preprocessing of files. */
176 /* ??? Even worse, it doesn't work, because gas does not accept the tab chars
177 that dwarf2out.c emits when #NO_APP. */
179 /* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
180 may as well fix at the same time. */
183 #undef ASM_FILE_START
184 #define ASM_FILE_START(STREAM) \
186 fputs (ASM_APP_OFF, STREAM); \
187 output_file_directive (STREAM, main_input_filename); \
191 /* Case label alignment is handled by ADDR_VEC_ALIGN now. */
193 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
194 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE)
196 /* We override svr4.h so that we can support the sdata section. */
198 #undef SELECT_SECTION
199 #define SELECT_SECTION(DECL,RELOC) \
201 if (TREE_CODE (DECL) == STRING_CST) \
203 if (! flag_writable_strings) \
208 else if (TREE_CODE (DECL) == VAR_DECL) \
210 if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] \
211 == SDATA_NAME_FLAG_CHAR) \
213 /* ??? We need the extra ! RELOC check, because the default is to \
214 only check RELOC if flag_pic is set, and we don't set flag_pic \
216 else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC)) \
221 /* This could be a CONSTRUCTOR containing ADDR_EXPR of a VAR_DECL, \
222 in which case we can't put it in a shared library rodata. */ \
223 else if (flag_pic && (RELOC)) \
229 /* Similarly for constant pool data. */
231 extern int ia64_section_threshold
;
232 #undef SELECT_RTX_SECTION
233 #define SELECT_RTX_SECTION(MODE, RTX) \
235 if (GET_MODE_SIZE (MODE) > 0 \
236 && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
238 else if (flag_pic && symbolic_operand ((RTX), (MODE))) \
244 #undef EXTRA_SECTIONS
245 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_sdata, in_sbss
247 #undef EXTRA_SECTION_FUNCTIONS
248 #define EXTRA_SECTION_FUNCTIONS \
249 CONST_SECTION_FUNCTION \
250 CTORS_SECTION_FUNCTION \
251 DTORS_SECTION_FUNCTION \
252 SDATA_SECTION_FUNCTION \
253 SBSS_SECTION_FUNCTION
255 #define SDATA_SECTION_ASM_OP ".sdata"
257 #define SDATA_SECTION_FUNCTION \
261 if (in_section != in_sdata) \
263 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
264 in_section = in_sdata; \
268 #define SBSS_SECTION_ASM_OP ".sbss"
270 #define SBSS_SECTION_FUNCTION \
274 if (in_section != in_sbss) \
276 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
277 in_section = in_sbss; \