OSDN Git Service

* alpha.c (print_operand_address): Fix format specifier warnings.
[pf3gnuchains/gcc-fork.git] / gcc / config / svr3.h
1 /* Operating system specific defines to be used when targeting GCC for
2    generic System V Release 3 system.
3    Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
4    Contributed by Ron Guilmette (rfg@monkeys.com).
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.
22
23    To use this file, make up a file with a name like:
24
25         ?????svr3.h
26
27    where ????? is replaced by the name of the basic hardware that you
28    are targeting for.  Then, in the file ?????svr3.h, put something
29    like:
30
31         #include "?????.h"
32         #include "svr3.h"
33 */
34
35 /* Define a symbol indicating that we are using svr3.h.  */
36 #define USING_SVR3_H
37
38 /* Define a symbol so that libgcc* can know what sort of operating
39    environment and assembler syntax we are targeting for.  */
40 #define SVR3_target
41
42 /* Assembler, linker, library, and startfile spec's.  */
43
44 /* Output at beginning of assembler file.  */
45 /* The .file command should always begin the output.  */
46
47 #undef ASM_FILE_START
48 #define ASM_FILE_START(FILE)                                    \
49   do { output_file_directive ((FILE), main_input_filename);     \
50        if (optimize) { ASM_FILE_START_1 (FILE); }               \
51      } while (0)
52
53 /* By default, do nothing: a few machines support .optim, but not most.  */
54 #undef ASM_FILE_START_1
55 #define ASM_FILE_START_1(FILE)
56
57 /* This says how to output an assembler line
58    to define a global common symbol.  */
59 /* We don't use ROUNDED because the standard compiler doesn't,
60    and the linker gives error messages if a common symbol
61    has more than one length value.  */
62
63 #undef ASM_OUTPUT_COMMON
64 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
65 ( fputs (".comm ", (FILE)),                     \
66   assemble_name ((FILE), (NAME)),               \
67   fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
68
69 /* This says how to output an assembler line
70    to define a local common symbol.  */
71
72 /* Note that using bss_section here caused errors
73    in building shared libraries on system V.3.  */
74 #undef ASM_OUTPUT_LOCAL
75 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)     \
76   do {                                                  \
77     int align = exact_log2 (ROUNDED);                   \
78     if (align > 2) align = 2;                           \
79     data_section ();                                    \
80     ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
81     ASM_OUTPUT_LABEL ((FILE), (NAME));                  \
82     fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED));        \
83   } while (0)
84
85 #if 0 /* For now, let's leave these machine-specific.  */
86 /* Use crt1.o as a startup file and crtn.o as a closing file.  */
87
88 #define STARTFILE_SPEC  \
89   "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
90
91 #ifdef CROSS_COMPILE
92 #define LIB_SPEC "-lc crtn.o%s"
93 #else
94 #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
95 #endif
96
97 /* Special flags for the linker.  I don't know what they do.  */
98
99 #define LINK_SPEC "%{T*} %{z:-lm}"
100 #endif
101
102 /* Output #ident as a .ident.  */
103
104 #undef  ASM_OUTPUT_IDENT
105 #define ASM_OUTPUT_IDENT(FILE, NAME) \
106   fprintf (FILE, "\t.ident \"%s\"\n", NAME);
107
108 /* Use periods rather than dollar signs in special g++ assembler names.  */
109
110 #define NO_DOLLAR_IN_LABEL
111
112 /* Implicit library calls should use memcpy, not bcopy, etc.  */
113
114 #define TARGET_MEM_FUNCTIONS
115
116 /* System V Release 3 uses COFF debugging info.  */
117
118 #define SDB_DEBUGGING_INFO 1
119
120 /* We don't want to output DBX debugging information.  */
121
122 #undef DBX_DEBUGGING_INFO
123
124 /* Define the actual types of some ANSI-mandated types.  These
125    definitions should work for most SVR3 systems.  */
126
127 #undef SIZE_TYPE
128 #define SIZE_TYPE "unsigned int"
129
130 #undef PTRDIFF_TYPE
131 #define PTRDIFF_TYPE "int"
132
133 #undef WCHAR_TYPE
134 #define WCHAR_TYPE "long int"
135
136 #undef WCHAR_TYPE_SIZE
137 #define WCHAR_TYPE_SIZE BITS_PER_WORD
138
139 /* The prefix to add to user-visible assembler symbols.
140
141    For System V Release 3 the convention is to prepend a leading
142    underscore onto user-level symbol names.  */
143
144 #undef USER_LABEL_PREFIX
145 #define USER_LABEL_PREFIX "_"
146
147 /* This is how to store into the string LABEL
148    the symbol_ref name of an internal numbered label where
149    PREFIX is the class of label and NUM is the number within the class.
150    This is suitable for output with `assemble_name'.
151
152    For most svr3 systems, the convention is that any symbol which begins
153    with a period is not put into the linker symbol table by the assembler.  */
154
155 #undef ASM_GENERATE_INTERNAL_LABEL
156 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
157   sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
158
159 /* We want local labels to start with period if made with asm_fprintf.  */
160 #undef LOCAL_LABEL_PREFIX
161 #define LOCAL_LABEL_PREFIX "."
162
163 /* Support const sections and the ctors and dtors sections for g++.  */
164
165 /* Define a few machine-specific details of the implementation of
166    constructors.
167
168    The __CTORS_LIST__ goes in the .init section.  Define CTOR_LIST_BEGIN
169    and CTOR_LIST_END to contribute to the .init section an instruction to
170    push a word containing 0 (or some equivalent of that).
171
172    Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor.  */
173
174 #define INIT_SECTION_ASM_OP     "\t.section\t.init"
175 #define FINI_SECTION_ASM_OP     "\t.section .fini,\"x\""
176 #define DTORS_SECTION_ASM_OP    FINI_SECTION_ASM_OP
177
178 /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
179    because they push on the stack.  */
180
181 #ifndef STACK_GROWS_DOWNWARD
182
183 /* Constructor list on stack is in reverse order.  Go to the end of the
184    list and go backwards to call constructors in the right order.  */
185 #define DO_GLOBAL_CTORS_BODY                                    \
186 do {                                                            \
187   func_ptr *p, *beg = alloca (0);                               \
188   for (p = beg; *p; p++)                                        \
189     ;                                                           \
190   while (p != beg)                                              \
191     (*--p) ();                                                  \
192 } while (0)
193
194 #else
195
196 /* Constructor list on stack is in correct order.  Just call them.  */
197 #define DO_GLOBAL_CTORS_BODY                                    \
198 do {                                                            \
199   func_ptr *p, *beg = alloca (0);                               \
200   for (p = beg; *p; )                                           \
201     (*p++) ();                                                  \
202 } while (0)
203
204 #endif /* STACK_GROWS_DOWNWARD */
205
206 #undef EXTRA_SECTIONS
207 #define EXTRA_SECTIONS in_init, in_fini
208
209 #undef EXTRA_SECTION_FUNCTIONS
210 #define EXTRA_SECTION_FUNCTIONS                                 \
211   INIT_SECTION_FUNCTION                                         \
212   FINI_SECTION_FUNCTION
213
214 #define INIT_SECTION_FUNCTION                                   \
215 void                                                            \
216 init_section ()                                                 \
217 {                                                               \
218   if (in_section != in_init)                                    \
219     {                                                           \
220       fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);      \
221       in_section = in_init;                                     \
222     }                                                           \
223 }
224
225 #define FINI_SECTION_FUNCTION                                   \
226 void                                                            \
227 fini_section ()                                                 \
228 {                                                               \
229   if (in_section != in_fini)                                    \
230     {                                                           \
231       fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);      \
232       in_section = in_fini;                                     \
233     }                                                           \
234 }