]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/ia64/sysv4.h
86d89acf1fb105b4716bee2fe2e1aeb3ae7cb240
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 "\tdata1\t"
14 #define STRING_ASM_OP "\tstringz\t"
17 #define SKIP_ASM_OP "\t.skip\t"
20 #define COMMON_ASM_OP "\t.common\t"
22 #undef ASCII_DATA_ASM_OP
23 #define ASCII_DATA_ASM_OP "\tstring\t"
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) \
41 && XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] == SDATA_NAME_FLAG_CHAR) \
45 ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
46 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
47 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
50 /* The # tells the Intel assembler that this is not a register name.
51 However, we can't emit the # in a label definition, so we set a variable
52 in ASM_OUTPUT_LABEL to control whether we want the postfix here or not.
53 We append the # to the label name, but since NAME can be an expression
54 we have to scan it for a non-label character and insert the # there. */
56 #undef ASM_OUTPUT_LABELREF
57 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
59 const char *name_ = NAME; \
60 if (*name_ == SDATA_NAME_FLAG_CHAR) \
65 fputs (user_label_prefix, STREAM); \
66 fputs (name_, STREAM); \
67 fputc ('#', STREAM); \
70 /* Intel assembler requires both flags and type if declaring a non-predefined
72 #undef INIT_SECTION_ASM_OP
73 #define INIT_SECTION_ASM_OP "\t.section\t.init,\"ax\",\"progbits\""
74 #undef FINI_SECTION_ASM_OP
75 #define FINI_SECTION_ASM_OP "\t.section\t.fini,\"ax\",\"progbits\""
77 /* svr4.h undefines this, so we need to define it here. */
78 #define DBX_REGISTER_NUMBER(REGNO) \
79 ia64_dbx_register_number(REGNO)
81 /* Things that svr4.h defines to the wrong type, because it assumes 32 bit
82 ints and 32 bit longs. */
85 #define SIZE_TYPE "long unsigned int"
88 #define PTRDIFF_TYPE "long int"
91 #define WCHAR_TYPE "int"
93 #undef WCHAR_TYPE_SIZE
94 #define WCHAR_TYPE_SIZE 32
96 /* We redefine this to use the ia64 .proc pseudo-op. */
98 #undef ASM_DECLARE_FUNCTION_NAME
99 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
101 fputs ("\t.proc ", FILE); \
102 assemble_name (FILE, NAME); \
103 fputc ('\n', FILE); \
104 ASM_OUTPUT_LABEL (FILE, NAME); \
107 /* We redefine this to use the ia64 .endp pseudo-op. */
109 #undef ASM_DECLARE_FUNCTION_SIZE
110 #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
112 fputs ("\t.endp ", FILE); \
113 assemble_name (FILE, NAME); \
114 fputc ('\n', FILE); \
117 /* A C expression which outputs to the stdio stream STREAM some appropriate
118 text to go at the start of an assembler file. */
120 /* ??? Looks like almost every port, except for a few original ones, get this
121 wrong. Must emit #NO_APP as first line of file to turn of special assembler
122 preprocessing of files. */
124 /* ??? Even worse, it doesn't work, because gas does not accept the tab chars
125 that dwarf2out.c emits when #NO_APP. */
127 /* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
128 may as well fix at the same time. */
130 #undef ASM_FILE_START
131 #define ASM_FILE_START(STREAM) \
133 output_file_directive (STREAM, main_input_filename); \
134 emit_safe_across_calls (STREAM); \
137 /* Case label alignment is handled by ADDR_VEC_ALIGN now. */
139 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
140 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE)
142 /* We override svr4.h so that we can support the sdata section. */
144 #undef SELECT_SECTION
145 #define SELECT_SECTION(DECL,RELOC) \
147 if (TREE_CODE (DECL) == STRING_CST) \
149 if (! flag_writable_strings) \
154 else if (TREE_CODE (DECL) == VAR_DECL) \
156 if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] \
157 == SDATA_NAME_FLAG_CHAR) \
159 /* ??? We need the extra ! RELOC check, because the default is to \
160 only check RELOC if flag_pic is set, and we don't set flag_pic \
162 else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC)) \
167 /* This could be a CONSTRUCTOR containing ADDR_EXPR of a VAR_DECL, \
168 in which case we can't put it in a shared library rodata. */ \
169 else if (flag_pic && (RELOC)) \
175 /* Similarly for constant pool data. */
177 extern unsigned int ia64_section_threshold
;
178 #undef SELECT_RTX_SECTION
179 #define SELECT_RTX_SECTION(MODE, RTX) \
181 if (GET_MODE_SIZE (MODE) > 0 \
182 && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
184 else if (flag_pic && symbolic_operand ((RTX), (MODE))) \
190 #undef EXTRA_SECTIONS
191 #define EXTRA_SECTIONS in_const, in_sdata, in_sbss
193 #undef EXTRA_SECTION_FUNCTIONS
194 #define EXTRA_SECTION_FUNCTIONS \
195 CONST_SECTION_FUNCTION \
196 SDATA_SECTION_FUNCTION \
197 SBSS_SECTION_FUNCTION
199 #define SDATA_SECTION_ASM_OP "\t.sdata"
201 #define SDATA_SECTION_FUNCTION \
205 if (in_section != in_sdata) \
207 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
208 in_section = in_sdata; \
212 #define SBSS_SECTION_ASM_OP "\t.sbss"
214 #define SBSS_SECTION_FUNCTION \
218 if (in_section != in_sbss) \
220 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
221 in_section = in_sbss; \