2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / ia64 / sysv4.h
blob15a57d924cd3d9a3374e37fa8769bf890c7e4409
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
11 definitions. */
13 #undef STRING_ASM_OP
14 #define STRING_ASM_OP "\tstringz\t"
16 #undef SKIP_ASM_OP
17 #define SKIP_ASM_OP "\t.skip\t"
19 #undef COMMON_ASM_OP
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? */
27 #undef ASM_SPEC
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
37 (*targetm.asm_out.globalize_label) 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) \
44 do { \
45 if ((DECL) && sdata_symbolic_operand (XEXP (DECL_RTL (DECL), 0), Pmode)) \
46 sbss_section (); \
47 else \
48 bss_section (); \
49 ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
50 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
51 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
52 } while (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.
57 We append the # to the label name, but since NAME can be an expression
58 we have to scan it for a non-label character and insert the # there. */
60 #undef ASM_OUTPUT_LABELREF
61 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
62 do { \
63 const char *name_ = NAME; \
64 if (*name_ == '*') \
65 name_++; \
66 else \
67 fputs (user_label_prefix, STREAM); \
68 fputs (name_, STREAM); \
69 if (!ia64_asm_output_label) \
70 fputc ('#', STREAM); \
71 } while (0)
73 /* Intel assembler requires both flags and type if declaring a non-predefined
74 section. */
75 #undef INIT_SECTION_ASM_OP
76 #define INIT_SECTION_ASM_OP "\t.section\t.init,\"ax\",\"progbits\""
77 #undef FINI_SECTION_ASM_OP
78 #define FINI_SECTION_ASM_OP "\t.section\t.fini,\"ax\",\"progbits\""
80 /* svr4.h undefines this, so we need to define it here. */
81 #define DBX_REGISTER_NUMBER(REGNO) \
82 ia64_dbx_register_number(REGNO)
84 /* Things that svr4.h defines to the wrong type, because it assumes 32 bit
85 ints and 32 bit longs. */
87 #undef SIZE_TYPE
88 #define SIZE_TYPE "long unsigned int"
90 #undef PTRDIFF_TYPE
91 #define PTRDIFF_TYPE "long int"
93 #undef WCHAR_TYPE
94 #define WCHAR_TYPE "int"
96 #undef WCHAR_TYPE_SIZE
97 #define WCHAR_TYPE_SIZE 32
99 /* We redefine this to use the ia64 .proc pseudo-op. */
101 #undef ASM_DECLARE_FUNCTION_NAME
102 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
103 do { \
104 fputs ("\t.proc ", FILE); \
105 assemble_name (FILE, NAME); \
106 fputc ('\n', FILE); \
107 ASM_OUTPUT_LABEL (FILE, NAME); \
108 } while (0)
110 /* We redefine this to use the ia64 .endp pseudo-op. */
112 #undef ASM_DECLARE_FUNCTION_SIZE
113 #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
114 do { \
115 fputs ("\t.endp ", FILE); \
116 assemble_name (FILE, NAME); \
117 fputc ('\n', FILE); \
118 } while (0)
120 /* Override default elf definition. */
121 #undef TARGET_ASM_SELECT_RTX_SECTION
122 #define TARGET_ASM_SELECT_RTX_SECTION ia64_select_rtx_section
124 #undef EXTRA_SECTIONS
125 #define EXTRA_SECTIONS in_sdata, in_sbss
127 #undef EXTRA_SECTION_FUNCTIONS
128 #define EXTRA_SECTION_FUNCTIONS \
129 SDATA_SECTION_FUNCTION \
130 SBSS_SECTION_FUNCTION
132 #define SDATA_SECTION_ASM_OP "\t.sdata"
134 #define SDATA_SECTION_FUNCTION \
135 void \
136 sdata_section (void) \
138 if (in_section != in_sdata) \
140 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
141 in_section = in_sdata; \
145 #define SBSS_SECTION_ASM_OP "\t.sbss"
147 #define SBSS_SECTION_FUNCTION \
148 void \
149 sbss_section (void) \
151 if (in_section != in_sbss) \
153 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
154 in_section = in_sbss; \