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.
6 This file is part of GNU CC.
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)
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.
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. */
24 #include "rs6000/powerpc.h"
26 /* Don't generate XCOFF debugging information. */
28 #undef XCOFF_DEBUGGING_INFO
30 /* Don't use the COFF object file format. */
32 #undef OBJECT_FORMAT_COFF
34 /* The XCOFF support uses weird symbol suffixes, which we don't want
37 #undef STRIP_NAME_ENCODING
39 /* Don't bother to output .extern pseudo-ops. They are not needed by
42 #undef ASM_OUTPUT_EXTERNAL
44 /* Undefine some things which are defined by the generic svr4.h. */
47 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
48 #undef READONLY_DATA_SECTION
50 #undef ASM_DECLARE_FUNCTION_NAME
52 /* Use the regular svr4 definitions. */
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
63 #undef ASM_DECLARE_FUNCTION_NAME
64 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
66 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
67 assemble_name (FILE, NAME); \
69 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
71 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
72 if (TREE_PUBLIC (DECL)) \
74 fprintf (FILE, "\t.globl ."); \
75 assemble_name (FILE, NAME); \
76 fprintf (FILE, "\n"); \
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"); \
85 fprintf (FILE, "."); \
86 ASM_OUTPUT_LABEL (FILE, NAME); \
89 /* We need to override the .size output in order to put a `.' before
92 #undef ASM_DECLARE_FUNCTION_SIZE
93 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
95 if (!flag_inhibit_size_directive) \
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)); \
112 /* Use ELF style section commands. */
114 #undef TEXT_SECTION_ASM_OP
115 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
117 #undef DATA_SECTION_ASM_OP
118 #define DATA_SECTION_ASM_OP "\t.section\t\".data\""
120 /* Besides the usual ELF sections, we need a toc section. */
122 #undef EXTRA_SECTIONS
123 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc
125 #undef EXTRA_SECTION_FUNCTIONS
126 #define EXTRA_SECTION_FUNCTIONS \
127 CONST_SECTION_FUNCTION \
128 CTORS_SECTION_FUNCTION \
129 DTORS_SECTION_FUNCTION \
132 #define TOC_SECTION_FUNCTION \
136 if (TARGET_MINIMAL_TOC) \
138 static int toc_initialized = 0; \
140 if (! toc_initialized) \
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; \
151 if (in_section != in_toc) \
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; \
161 #define TOC_SECTION_ASM_OP "\t.section\t.got,\"aw\""
162 #define MINIMAL_TOC_SECTION_ASM_OP "\t.section\t.got1,\"aw\""
164 /* Use the TOC section for TOC entries. */
166 #undef SELECT_RTX_SECTION
167 #define SELECT_RTX_SECTION(MODE, X) \
168 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
174 /* How to renumber registers for dbx and gdb. */
176 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
178 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
180 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
181 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
182 fprintf (FILE, ".%s", PREFIX)
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} \
202 %{mcpu=rsc1: -mpwr} \
207 %{mcpu=603e: -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. */
213 /* Enable output of DBX (stabs) debugging information when asked for it. */
215 #define DBX_DEBUGGING_INFO
217 /* Prefer DBX (stabs) debugging information over the native (DWARF) format. */
219 #undef PREFERRED_DEBUGGING_TYPE
220 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
222 /* Line numbers are relative to the current function. */
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",\
229 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
233 /* But, to make this work, we have to output the stabs for the function
236 #define DBX_FUNCTION_FIRST
238 /* We need to output LBRAC and RBRAC lines specially to include the
239 dot in from of the text symbol for a function. */
241 #define DBX_OUTPUT_LBRAC(FILE, BUF) \
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"); \
253 #define DBX_OUTPUT_RBRAC(FILE, BUF) \
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"); \
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. */
270 #define DBX_FINISH_SYMBOL(sym) \
273 if (use_gnu_debug_info_extensions && sym != 0) \
274 line = DECL_SOURCE_LINE (sym); \
276 fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line); \
277 if (current_sym_addr) \
279 if (TREE_CODE (sym) == FUNCTION_DECL) \
280 fprintf (asmfile, "."); \
281 output_addr_const (asmfile, current_sym_addr); \
284 fprintf (asmfile, "%d", current_sym_value); \
285 putc ('\n', asmfile); \
288 /* This is the end of what might become sysv4dbx.h. */
290 #undef TARGET_VERSION
291 #define TARGET_VERSION fprintf (stderr, " (PowerPC Netware)");
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)"