OSDN Git Service

remove -mcpu=rs6000
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / netware.h
1 /* Core target definitions for GNU compiler
2    for IBM RS/6000 PowerPC running NetWare
3    Copyright (C) 1994 Free Software Foundation, Inc.
4    Contributed by Cygnus Support.
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 #define TARGET_AIX 0
23
24 #include "rs6000/powerpc.h"
25
26 /* Don't generate XCOFF debugging information.  */
27
28 #undef XCOFF_DEBUGGING_INFO
29
30 /* Don't use the COFF object file format.  */
31
32 #undef OBJECT_FORMAT_COFF
33
34 /* The XCOFF support uses weird symbol suffixes, which we don't want
35    for ELF.  */
36
37 #undef STRIP_NAME_ENCODING
38
39 /* Don't bother to output .extern pseudo-ops.  They are not needed by
40    ELF assemblers.  */
41
42 #undef ASM_OUTPUT_EXTERNAL
43
44 /* Undefine some things which are defined by the generic svr4.h.  */
45
46 #undef ASM_FILE_END
47 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
48 #undef READONLY_DATA_SECTION
49 #undef SELECT_SECTION
50 #undef ASM_DECLARE_FUNCTION_NAME
51
52 /* Use the regular svr4 definitions.  */
53
54 #include "svr4.h"
55 #include "netware.h"
56
57 /* Create a function descriptor when we declare a function name.  This
58    is a mixture of the ASM_DECLARE_FUNCTION_NAME macros in rs6000.h
59    and svr4.h.  The unmodified function name is used to name the
60    descriptor.  The function name with an initial `.' is used to name
61    the code.  */
62
63 #undef ASM_DECLARE_FUNCTION_NAME
64 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
65   do {                                                                  \
66     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                             \
67     assemble_name (FILE, NAME);                                         \
68     putc (',', FILE);                                                   \
69     fprintf (FILE, TYPE_OPERAND_FMT, "function");                       \
70     putc ('\n', FILE);                                                  \
71     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
72     if (TREE_PUBLIC (DECL))                                             \
73       {                                                                 \
74         fprintf (FILE, "\t.globl .");                                   \
75         assemble_name (FILE, NAME);                                     \
76         fprintf (FILE, "\n");                                           \
77       }                                                                 \
78     data_section ();                                                    \
79     ASM_OUTPUT_ALIGN (FILE, 2);                                         \
80     ASM_OUTPUT_LABEL (FILE, NAME);                                      \
81     fprintf (FILE, "\t.long .");                                        \
82     assemble_name (FILE, NAME);                                         \
83     fprintf (FILE, ", __GOT0, 0\n");                                    \
84     text_section ();                                                    \
85     fprintf (FILE, ".");                                                \
86     ASM_OUTPUT_LABEL (FILE, NAME);                                      \
87   } while (0)
88
89 /* We need to override the .size output in order to put a `.' before
90    the function name.  */
91
92 #undef ASM_DECLARE_FUNCTION_SIZE
93 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
94   do {                                                                  \
95     if (!flag_inhibit_size_directive)                                   \
96       {                                                                 \
97         char label[256];                                                \
98         static int labelno;                                             \
99         labelno++;                                                      \
100         ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);            \
101         ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);               \
102         fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                         \
103         assemble_name (FILE, (FNAME));                                  \
104         fprintf (FILE, ",");                                            \
105         assemble_name (FILE, label);                                    \
106         fprintf (FILE, "-.");                                           \
107         assemble_name (FILE, (FNAME));                                  \
108         putc ('\n', FILE);                                              \
109       }                                                                 \
110   } while (0)
111
112 /* Use ELF style section commands.  */
113
114 #undef TEXT_SECTION_ASM_OP
115 #define TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
116
117 #undef DATA_SECTION_ASM_OP
118 #define DATA_SECTION_ASM_OP     "\t.section\t\".data\""
119
120 /* Besides the usual ELF sections, we need a toc section.  */
121
122 #undef EXTRA_SECTIONS
123 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc
124
125 #undef EXTRA_SECTION_FUNCTIONS
126 #define EXTRA_SECTION_FUNCTIONS                                         \
127   CONST_SECTION_FUNCTION                                                \
128   CTORS_SECTION_FUNCTION                                                \
129   DTORS_SECTION_FUNCTION                                                \
130   TOC_SECTION_FUNCTION
131
132 #define TOC_SECTION_FUNCTION                                            \
133 void                                                                    \
134 toc_section ()                                                          \
135 {                                                                       \
136   if (TARGET_MINIMAL_TOC)                                               \
137     {                                                                   \
138       static int toc_initialized = 0;                                   \
139                                                                         \
140       if (! toc_initialized)                                            \
141         {                                                               \
142           fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);           \
143           fprintf (asm_out_file, ".LCTOC0:\n");                         \
144           fprintf (asm_out_file, "\t.tc .LCTOC1\n");                    \
145           fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);   \
146           fprintf (asm_out_file, ".LCTOC1:\n");                         \
147           toc_initialized = 1;                                          \
148         }                                                               \
149     }                                                                   \
150                                                                         \
151   if (in_section != in_toc)                                             \
152     {                                                                   \
153       fprintf (asm_out_file, "%s\n",                                    \
154                (TARGET_MINIMAL_TOC                                      \
155                 ? MINIMAL_TOC_SECTION_ASM_OP                            \
156                 : TOC_SECTION_ASM_OP));                                 \
157       in_section = in_toc;                                              \
158     }                                                                   \
159 }
160
161 #define TOC_SECTION_ASM_OP "\t.section\t.got,\"aw\""
162 #define MINIMAL_TOC_SECTION_ASM_OP "\t.section\t.got1,\"aw\""
163
164 /* Use the TOC section for TOC entries.  */
165
166 #undef SELECT_RTX_SECTION
167 #define SELECT_RTX_SECTION(MODE, X)             \
168 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X))      \
169     toc_section ();                             \
170   else                                          \
171     const_section ();                           \
172 }
173
174 /* How to renumber registers for dbx and gdb.  */
175
176 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
177
178 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL.  */
179
180 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
181 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)   \
182   fprintf (FILE, ".%s", PREFIX)
183
184 #undef ASM_SPEC
185 #define ASM_SPEC "\
186 -u \
187 %{!mcpu*: \
188   %{mpower2: -mpwrx} \
189   %{mpowerpc*: %{!mpower: -mppc}} \
190   %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \
191   %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \
192   %{!mno-powerpc: %{mpower: -m601}} \
193   %{!mno-powerpc: %{!mpower: -mppc}}} \
194 %{mcpu=common: -mcom} \
195 %{mcpu=power: -mpwr} \
196 %{mcpu=power2: -mpwrx} \
197 %{mcpu=powerpc: -mppc} \
198 %{mcpu=rios: -mpwr} \
199 %{mcpu=rios1: -mpwr} \
200 %{mcpu=rios2: -mpwrx} \
201 %{mcpu=rsc: -mpwr} \
202 %{mcpu=rsc1: -mpwr} \
203 %{mcpu=403: -mppc} \
204 %{mcpu=601: -m601} \
205 %{mcpu=602: -mppc} \
206 %{mcpu=603: -mppc} \
207 %{mcpu=603e: -mppc} \
208 %{mcpu=604: -mppc} \
209 %{mcpu=620: -mppc} \
210 %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
211 /* This is the end of what might become sysv4.h.  */
212
213 /* Enable output of DBX (stabs) debugging information when asked for it.  */
214
215 #define DBX_DEBUGGING_INFO
216
217 /* Prefer DBX (stabs) debugging information over the native (DWARF) format. */
218
219 #undef PREFERRED_DEBUGGING_TYPE
220 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
221
222 /* Line numbers are relative to the current function.  */
223
224 #undef  ASM_OUTPUT_SOURCE_LINE
225 #define ASM_OUTPUT_SOURCE_LINE(file, line)              \
226   { static int sym_lineno = 1;                          \
227     fprintf (file, ".stabn 68,0,%d,.LM%d-.%s\n.LM%d:\n",\
228              line, sym_lineno,                          \
229              XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
230              sym_lineno);                               \
231     sym_lineno += 1; }
232
233 /* But, to make this work, we have to output the stabs for the function
234    name *first*...  */
235
236 #define DBX_FUNCTION_FIRST
237
238 /* We need to output LBRAC and RBRAC lines specially to include the
239    dot in from of the text symbol for a function.  */
240
241 #define DBX_OUTPUT_LBRAC(FILE, BUF)                                        \
242 do                                                                         \
243   {                                                                        \
244     fprintf (FILE, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC);                   \
245     assemble_name (FILE, BUF);                                             \
246     fprintf (FILE, "-.");                                                  \
247     assemble_name (asmfile,                                                \
248                    XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));  \
249     fprintf (asmfile, "\n");                                               \
250   }                                                                        \
251 while (0)
252
253 #define DBX_OUTPUT_RBRAC(FILE, BUF)                                        \
254 do                                                                         \
255   {                                                                        \
256     fprintf (FILE, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC);                   \
257     assemble_name (FILE, BUF);                                             \
258     fprintf (FILE, "-.");                                                  \
259     assemble_name (asmfile,                                                \
260                    XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));  \
261     fprintf (asmfile, "\n");                                               \
262   }                                                                        \
263 while (0)
264
265 /* We are using function descriptors, so the value of a function
266    symbol is in the .data section.  However, we want the stabs entry
267    for that function to point at the actual function code in the .text
268    section, which we get by prefixing the symbol with a dot.  */
269
270 #define DBX_FINISH_SYMBOL(sym)                                          \
271 do {                                                                    \
272   int line = 0;                                                         \
273   if (use_gnu_debug_info_extensions && sym != 0)                        \
274     line = DECL_SOURCE_LINE (sym);                                      \
275                                                                         \
276   fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line);             \
277   if (current_sym_addr)                                                 \
278     {                                                                   \
279       if (TREE_CODE (sym) == FUNCTION_DECL)                             \
280         fprintf (asmfile, ".");                                         \
281       output_addr_const (asmfile, current_sym_addr);                    \
282     }                                                                   \
283   else                                                                  \
284     fprintf (asmfile, "%d", current_sym_value);                         \
285   putc ('\n', asmfile);                                                 \
286 } while (0)
287
288 /* This is the end of what might become sysv4dbx.h.  */
289
290 #undef TARGET_VERSION
291 #define TARGET_VERSION fprintf (stderr, " (PowerPC Netware)");
292
293 /* FIXME: These should actually indicate PowerPC, when there is some
294    standard way of expressing that.  */
295 #undef CPP_PREDEFINES
296 #define CPP_PREDEFINES \
297   "-DPPC D__netware__ -Asystem(netware) -Acpu(powerpc) -Amachine(powerpc)"