]>
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 /* Stabs does not work properly for 64-bit targets. */
8 #undef DBX_DEBUGGING_INFO
10 /* Various pseudo-ops for which the Intel assembler uses non-standard
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 /* ia64-specific options for gas
26 ??? ia64 gas doesn't accept standard svr4 assembler options? */
28 #define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic} %(asm_extra)"
30 /* ??? Unfortunately, .lcomm doesn't work, because it puts things in either
31 .bss or .sbss, and we can't control the decision of which is used. When
32 I use .lcomm, I get a cryptic "Section group has no member" error from
33 the Intel simulator. So we must explicitly put variables in .bss
34 instead. This matters only if we care about the Intel assembler. */
36 /* This is asm_output_aligned_bss from varasm.c without the ASM_GLOBALIZE_LABEL
37 call at the beginning. */
39 /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME. */
40 extern int size_directive_output
;
42 #undef ASM_OUTPUT_ALIGNED_LOCAL
43 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
46 && XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] == SDATA_NAME_FLAG_CHAR) \
50 ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
51 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
52 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
55 /* The # tells the Intel assembler that this is not a register name.
56 However, we can't emit the # in a label definition, so we set a variable
57 in ASM_OUTPUT_LABEL to control whether we want the postfix here or not.
58 We append the # to the label name, but since NAME can be an expression
59 we have to scan it for a non-label character and insert the # there. */
61 #undef ASM_OUTPUT_LABELREF
62 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
64 const char *name_ = NAME; \
65 if (*name_ == SDATA_NAME_FLAG_CHAR) \
70 fputs (user_label_prefix, STREAM); \
71 fputs (name_, STREAM); \
72 if (!ia64_asm_output_label) \
73 fputc ('#', STREAM); \
76 /* Intel assembler requires both flags and type if declaring a non-predefined
78 #undef INIT_SECTION_ASM_OP
79 #define INIT_SECTION_ASM_OP "\t.section\t.init,\"ax\",\"progbits\""
80 #undef FINI_SECTION_ASM_OP
81 #define FINI_SECTION_ASM_OP "\t.section\t.fini,\"ax\",\"progbits\""
83 /* svr4.h undefines this, so we need to define it here. */
84 #define DBX_REGISTER_NUMBER(REGNO) \
85 ia64_dbx_register_number(REGNO)
87 /* Things that svr4.h defines to the wrong type, because it assumes 32 bit
88 ints and 32 bit longs. */
91 #define SIZE_TYPE "long unsigned int"
94 #define PTRDIFF_TYPE "long int"
97 #define WCHAR_TYPE "int"
99 #undef WCHAR_TYPE_SIZE
100 #define WCHAR_TYPE_SIZE 32
102 /* We redefine this to use the ia64 .proc pseudo-op. */
104 #undef ASM_DECLARE_FUNCTION_NAME
105 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
107 fputs ("\t.proc ", FILE); \
108 assemble_name (FILE, NAME); \
109 fputc ('\n', FILE); \
110 ASM_OUTPUT_LABEL (FILE, NAME); \
113 /* We redefine this to use the ia64 .endp pseudo-op. */
115 #undef ASM_DECLARE_FUNCTION_SIZE
116 #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
118 fputs ("\t.endp ", FILE); \
119 assemble_name (FILE, NAME); \
120 fputc ('\n', FILE); \
123 /* A C expression which outputs to the stdio stream STREAM some appropriate
124 text to go at the start of an assembler file. */
126 /* ??? Looks like almost every port, except for a few original ones, get this
127 wrong. Must emit #NO_APP as first line of file to turn of special assembler
128 preprocessing of files. */
130 /* ??? Even worse, it doesn't work, because gas does not accept the tab chars
131 that dwarf2out.c emits when #NO_APP. */
133 /* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
134 may as well fix at the same time. */
136 #undef ASM_FILE_START
137 #define ASM_FILE_START(STREAM) \
139 output_file_directive (STREAM, main_input_filename); \
140 emit_safe_across_calls (STREAM); \
143 /* Similarly for constant pool data. */
145 extern unsigned int ia64_section_threshold
;
146 #undef SELECT_RTX_SECTION
147 #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
149 if (GET_MODE_SIZE (MODE) > 0 \
150 && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
152 else if (flag_pic && symbolic_operand ((RTX), (MODE))) \
155 mergeable_constant_section ((MODE), (ALIGN), 0); \
158 #undef EXTRA_SECTIONS
159 #define EXTRA_SECTIONS in_sdata, in_sbss
161 #undef EXTRA_SECTION_FUNCTIONS
162 #define EXTRA_SECTION_FUNCTIONS \
163 SDATA_SECTION_FUNCTION \
164 SBSS_SECTION_FUNCTION
166 #define SDATA_SECTION_ASM_OP "\t.sdata"
168 #define SDATA_SECTION_FUNCTION \
172 if (in_section != in_sdata) \
174 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
175 in_section = in_sdata; \
179 #define SBSS_SECTION_ASM_OP "\t.sbss"
181 #define SBSS_SECTION_FUNCTION \
185 if (in_section != in_sbss) \
187 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
188 in_section = in_sbss; \