OSDN Git Service

Use new file names for included sparc files.
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / sol2.h
1 /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
2    Copyright 1992 Free Software Foundation, Inc.
3    Contributed by Ron Guilmette (rfg@ncd.com) and
4    David V. Henkel-Wallace (gumby@cygnus.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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22 /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
23 #include "sparc/sparcv4.h"
24
25 #undef CPP_PREDEFINES
26 #define CPP_PREDEFINES \
27  "-Dsun -Dsparc -Dunix -D__svr4__ -Asystem(unix) -Acpu(sparc) -Amachine(sparc)"
28
29 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
30    It's safe to pass -s always, even if -g is not used. */
31 #undef ASM_SPEC
32 #define ASM_SPEC \
33   "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
34    %{fpic:-K PIC} %{fPIC:-K PIC}"
35
36 /* However it appears that Solaris 2.0 uses the same reg numbering as
37    the old BSD-style system did. */
38
39 #undef DBX_REGISTER_NUMBER
40 /* Same as sparc.h */
41 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
42
43 /* We use stabs-in-elf for debugging, because that is what the native
44    toolchain uses.  */
45 #define DBX_DEBUGGING_INFO
46 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
47
48 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
49
50 /* "gcc2_compiled." must be a .stabs, not an ordinary symbol, or GDB won't
51    see it.  Furthermore, since GDB reads the input piecemeal, starting
52    with each N_SO, it's a lot easier if the gcc2 flag symbol is *after*
53    the N_SO rather than before it.  So we emit an N_OPT stab here.  */
54
55 #define ASM_IDENTIFY_GCC(FILE)  /* Do nothing */
56
57 #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE)     \
58  fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE)
59
60 #undef CTORS_SECTION_ASM_OP
61 #undef DTORS_SECTION_ASM_OP
62
63 #if 0 /* These seems unnecessary; the ones in sparcv4.h look right.  */
64 #undef TEXT_SECTION_ASM_OP
65 #undef DATA_SECTION_ASM_OP
66 #undef BSS_SECTION_ASM_OP
67 #undef CONST_SECTION_ASM_OP
68 #undef INIT_SECTION_ASM_OP
69
70 #define TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
71 #define DATA_SECTION_ASM_OP     "\t.section\t\".data\""
72 #define BSS_SECTION_ASM_OP      "\t.section\t\".bss\""
73
74 #define CONST_SECTION_ASM_OP    "\t.section\t\".rodata\""
75 #define INIT_SECTION_ASM_OP     "\t.section\t\".init\""
76 #endif
77
78 #define CTORS_SECTION_ASM_OP    "\t.section\t\".ctors\",#alloc,#execinstr\n"
79 #define DTORS_SECTION_ASM_OP    "\t.section\t\".dtors\",#alloc,#execinstr\n"
80
81 /* The native assembler can't compute differences between symbols in different
82    sections when generating pic code, so we must put jump tables in the
83    text section.  */
84 #define JUMP_TABLES_IN_TEXT_SECTION 1
85
86 /* Must use data section for relocatable constants when pic.  */
87 #undef SELECT_RTX_SECTION
88 #define SELECT_RTX_SECTION(MODE,RTX)            \
89 {                                               \
90   if (flag_pic && symbolic_operand (RTX))       \
91     data_section ();                            \
92   else                                          \
93     const_section ();                           \
94 }
95
96 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
97 #undef ASM_OUTPUT_SKIP
98 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
99   fprintf (FILE, "\t.skip %u\n", (SIZE))
100
101 #undef ASM_OUTPUT_ALIGNED_LOCAL
102 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
103 do {                                                                    \
104   fputs ("\t.local\t", (FILE));         \
105   assemble_name ((FILE), (NAME));                                       \
106   putc ('\n', (FILE));                                                  \
107   ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN);                  \
108 } while (0)
109
110 #undef COMMON_ASM_OP
111 #define COMMON_ASM_OP "\t.common"
112
113 /* This is how to output a definition of an internal numbered label where
114    PREFIX is the class of label and NUM is the number within the class.  */
115
116 #undef  ASM_OUTPUT_INTERNAL_LABEL
117 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
118   fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
119
120 /* This is how to output a reference to an internal numbered label where
121    PREFIX is the class of label and NUM is the number within the class.  */
122
123 #undef  ASM_OUTPUT_INTERNAL_LABELREF
124 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)   \
125   fprintf (FILE, ".L%s%d", PREFIX, NUM)
126
127 /* This is how to store into the string LABEL
128    the symbol_ref name of an internal numbered label where
129    PREFIX is the class of label and NUM is the number within the class.
130    This is suitable for output with `assemble_name'.  */
131
132 #undef  ASM_GENERATE_INTERNAL_LABEL
133 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
134   sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
135
136 /* in Solaris 2.0, linenos are relative to the current fn. */
137 #undef  ASM_OUTPUT_SOURCE_LINE
138 #define ASM_OUTPUT_SOURCE_LINE(file, line)              \
139   { static int sym_lineno = 1;                          \
140     fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n", \
141              line, sym_lineno,                          \
142              IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),\
143              sym_lineno);                               \
144     sym_lineno += 1; }
145
146 /* But, to make this work, we have to output the stabs for the function
147    name *first*...  */
148 #define DBX_FUNCTION_FIRST
149
150 \f
151 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
152    We don't use the standard LIB_SPEC only because we don't yet support c++ */
153
154 /* If we cannot find the GNU *crt*.o files in the STANDARD_STARTFILE_PREFIX
155    directory, our fallback strategy must be to look for these files instead
156    in the Sun C 2.0 directory.  */
157
158 #undef MD_STARTFILE_PREFIX
159 #define MD_STARTFILE_PREFIX "/opt/SUNWspro/SC2.0/"
160
161 #undef  STARTFILE_SPEC
162 #define STARTFILE_SPEC "%{!shared: \
163                          %{!symbolic: \
164                           %{pg:crt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
165                           %{pg:gmon.o%s} \
166                           %{pg:crti.o%s}%{!pg:crti.o%s} \
167                           %{ansi:/usr/ccs/lib/values-Xc.o%s} \
168                           %{!ansi: \
169                            %{traditional:/usr/ccs/lib/values-Xt.o%s} \
170                            %{!traditional:/usr/ccs/lib/values-Xa.o%s}}}} \
171                           crtbegin.o%s"
172
173 #undef  LIB_SPEC
174 #define LIB_SPEC \
175   "%{!shared:%{!symbolic:-lc}} \
176   crtend.o%s \
177   %{!shared:%{!symbolic:%{pg:crtn.o%s}%{!pg:crtn.o%s}}}"
178
179 /* This should be the same as in svr4.h, except with -R added.  */
180 #undef LINK_SPEC
181 #define LINK_SPEC "%{h*} %{V} %{v:%{!V:-V}} \
182                    %{b} %{Wl,*:%*} \
183                    %{static:-dn -Bstatic} \
184                    %{shared:-G -dy} \
185                    %{symbolic:-Bsymbolic -G -dy} \
186                    %{G:-G} \
187                    %{YP,*} \
188                    %{R*} \
189                    %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
190                     %{!p:-Y P,/usr/ccs/lib:/usr/lib}} \
191                    %{Qy:} %{!Qn:-Qy}"
192
193 /* This defines which switch letters take arguments.
194    It is as in svr4.h but with -R added.  */
195
196 #undef SWITCH_TAKES_ARG
197 #define SWITCH_TAKES_ARG(CHAR) \
198   (   (CHAR) == 'D' \
199    || (CHAR) == 'U' \
200    || (CHAR) == 'o' \
201    || (CHAR) == 'e' \
202    || (CHAR) == 'u' \
203    || (CHAR) == 'I' \
204    || (CHAR) == 'm' \
205    || (CHAR) == 'L' \
206    || (CHAR) == 'R' \
207    || (CHAR) == 'A' \
208    || (CHAR) == 'h' \
209    || (CHAR) == 'z')