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