OSDN Git Service

* i386.h (MIN_UNITS_PER_WORD): Define to 8 for x86-64 libgcc.
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / sysv4.h
1 /* Override definitions in elfos.h/svr4.h to be correct for IA64.  */
2
3 /* We want DWARF2 as specified by the IA64 ABI.  */
4 #undef PREFERRED_DEBUGGING_TYPE
5 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
6
7 /* Stabs does not work properly for 64-bit targets.  */
8 #undef DBX_DEBUGGING_INFO
9
10 /* Various pseudo-ops for which the Intel assembler uses non-standard
11    definitions.  */
12
13 #undef STRING_ASM_OP
14 #define STRING_ASM_OP "\tstringz\t"
15
16 #undef SKIP_ASM_OP
17 #define SKIP_ASM_OP "\t.skip\t"
18
19 #undef COMMON_ASM_OP
20 #define COMMON_ASM_OP "\t.common\t"
21
22 #undef ASCII_DATA_ASM_OP
23 #define ASCII_DATA_ASM_OP "\tstring\t"
24
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)"
29
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.  */
35
36 /* This is asm_output_aligned_bss from varasm.c without the
37    (*targetm.asm_out.globalize_label) call at the beginning.  */
38
39 /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME.  */
40 extern int size_directive_output;
41
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)
53
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.  */
59
60 #undef ASM_OUTPUT_LABELREF
61 #define ASM_OUTPUT_LABELREF(STREAM, NAME)       \
62 do {                                            \
63   const char *name_ = NAME;                     \
64   if (*name_ == ENCODE_SECTION_INFO_CHAR)       \
65     name_ += 2;                                 \
66   if (*name_ == '*')                            \
67     name_++;                                    \
68   else                                          \
69     fputs (user_label_prefix, STREAM);          \
70   fputs (name_, STREAM);                        \
71   if (!ia64_asm_output_label)                   \
72     fputc ('#', STREAM);                        \
73 } while (0)
74
75 /* Intel assembler requires both flags and type if declaring a non-predefined
76    section.  */
77 #undef INIT_SECTION_ASM_OP
78 #define INIT_SECTION_ASM_OP     "\t.section\t.init,\"ax\",\"progbits\""
79 #undef FINI_SECTION_ASM_OP
80 #define FINI_SECTION_ASM_OP     "\t.section\t.fini,\"ax\",\"progbits\""
81
82 /* svr4.h undefines this, so we need to define it here.  */
83 #define DBX_REGISTER_NUMBER(REGNO) \
84   ia64_dbx_register_number(REGNO)
85
86 /* Things that svr4.h defines to the wrong type, because it assumes 32 bit
87    ints and 32 bit longs.  */
88
89 #undef SIZE_TYPE
90 #define SIZE_TYPE "long unsigned int"
91
92 #undef PTRDIFF_TYPE
93 #define PTRDIFF_TYPE "long int"
94
95 #undef WCHAR_TYPE
96 #define WCHAR_TYPE "int"
97
98 #undef WCHAR_TYPE_SIZE
99 #define WCHAR_TYPE_SIZE 32
100
101 /* We redefine this to use the ia64 .proc pseudo-op.  */
102
103 #undef ASM_DECLARE_FUNCTION_NAME
104 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
105 do {                                                                    \
106   fputs ("\t.proc ", FILE);                                             \
107   assemble_name (FILE, NAME);                                           \
108   fputc ('\n', FILE);                                                   \
109   ASM_OUTPUT_LABEL (FILE, NAME);                                        \
110 } while (0)
111
112 /* We redefine this to use the ia64 .endp pseudo-op.  */
113
114 #undef ASM_DECLARE_FUNCTION_SIZE
115 #define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
116 do {                                                                    \
117   fputs ("\t.endp ", FILE);                                             \
118   assemble_name (FILE, NAME);                                           \
119   fputc ('\n', FILE);                                                   \
120 } while (0)
121
122 /* A C expression which outputs to the stdio stream STREAM some appropriate
123    text to go at the start of an assembler file.  */
124
125 /* ??? Looks like almost every port, except for a few original ones, get this
126    wrong.  Must emit #NO_APP as first line of file to turn of special assembler
127    preprocessing of files.  */
128
129 /* ??? Even worse, it doesn't work, because gas does not accept the tab chars
130    that dwarf2out.c emits when #NO_APP.  */
131
132 /* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
133    may as well fix at the same time.  */
134
135 #undef ASM_FILE_START
136 #define ASM_FILE_START(STREAM) \
137 do {                                                                    \
138   output_file_directive (STREAM, main_input_filename);                  \
139   emit_safe_across_calls (STREAM);                                      \
140 } while (0)
141
142 /* Override default elf definition.  */
143 #undef  TARGET_ASM_SELECT_RTX_SECTION
144 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_select_rtx_section
145
146 #undef EXTRA_SECTIONS
147 #define EXTRA_SECTIONS in_sdata, in_sbss
148
149 #undef EXTRA_SECTION_FUNCTIONS
150 #define EXTRA_SECTION_FUNCTIONS                                         \
151   SDATA_SECTION_FUNCTION                                                \
152   SBSS_SECTION_FUNCTION
153
154 #define SDATA_SECTION_ASM_OP "\t.sdata"
155
156 #define SDATA_SECTION_FUNCTION                                          \
157 void                                                                    \
158 sdata_section ()                                                        \
159 {                                                                       \
160   if (in_section != in_sdata)                                           \
161     {                                                                   \
162       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
163       in_section = in_sdata;                                            \
164     }                                                                   \
165 }
166
167 #define SBSS_SECTION_ASM_OP "\t.sbss"
168
169 #define SBSS_SECTION_FUNCTION                                           \
170 void                                                                    \
171 sbss_section ()                                                         \
172 {                                                                       \
173   if (in_section != in_sbss)                                            \
174     {                                                                   \
175       fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);              \
176       in_section = in_sbss;                                             \
177     }                                                                   \
178 }