* rtl.h (rtunion_def): Constify member `rtstr'.
[official-gcc.git] / gcc / config / mips / netbsd.h
blob81e5eaed488efd565d6e9857aa204745bd65f280
1 /* Definitions for DECstation running BSD as target machine for GNU compiler.
2 Copyright (C) 1993, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #define DECSTATION
23 /* Look for the include files in the system-defined places. */
25 #ifndef CROSS_COMPILE
26 #undef GPLUSPLUS_INCLUDE_DIR
27 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
29 #undef GCC_INCLUDE_DIR
30 #define GCC_INCLUDE_DIR "/usr/include"
32 #undef INCLUDE_DEFAULTS
33 #define INCLUDE_DEFAULTS \
34 { \
35 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
36 { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
37 { 0, 0, 0, 0 } \
40 /* Under NetBSD, the normal location of the various *crt*.o files is the
41 /usr/lib directory. */
43 #undef STANDARD_STARTFILE_PREFIX
44 #define STANDARD_STARTFILE_PREFIX "/usr/lib/"
45 #endif
47 /* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support
48 for the special GCC options -static, -assert, and -nostdlib. */
50 #undef LINK_SPEC
51 #define LINK_SPEC \
52 "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
53 %{!nostartfiles:%{!r*:%{!e*:-e __start}}} -dc -dp %{static:-Bstatic} %{assert*}"
55 /* Implicit library calls should use memcpy, not bcopy, etc. */
57 #define TARGET_MEM_FUNCTIONS
59 /* Define mips-specific netbsd predefines... */
60 #ifndef CPP_PREDEFINES
61 #define CPP_PREDEFINES "-D__ANSI_COMPAT \
62 -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__NetBSD__ -Dmips \
63 -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ \
64 -Dunix -D_R3000 \
65 -Asystem(unix) -Asystem(NetBSD) -Amachine(mips)"
66 #endif
68 #ifndef SUBTARGET_CPP_SPEC
69 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
70 #endif
72 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
73 #define STARTFILE_SPEC ""
75 #ifndef MACHINE_TYPE
76 #define MACHINE_TYPE "NetBSD/pmax"
77 #endif
79 #define TARGET_DEFAULT MASK_GAS
80 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
82 #include "mips/mips.h"
85 * Some imports from svr4.h in support of shared libraries.
86 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
89 /* Define the strings used for the special svr4 .type and .size directives.
90 These strings generally do not vary from one system running svr4 to
91 another, but if a given system (e.g. m88k running svr) needs to use
92 different pseudo-op names for these, they may be overridden in the
93 file which includes this one. */
95 #undef TYPE_ASM_OP
96 #undef SIZE_ASM_OP
97 #undef WEAK_ASM_OP
98 #define TYPE_ASM_OP ".type"
99 #define SIZE_ASM_OP ".size"
100 #define WEAK_ASM_OP ".weak"
102 /* The following macro defines the format used to output the second
103 operand of the .type assembler directive. Different svr4 assemblers
104 expect various different forms for this operand. The one given here
105 is just a default. You may need to override it in your machine-
106 specific tm.h file (depending upon the particulars of your assembler). */
108 #undef TYPE_OPERAND_FMT
109 #define TYPE_OPERAND_FMT "@%s"
111 /* Write the extra assembler code needed to declare a function's result.
112 Most svr4 assemblers don't require any special declaration of the
113 result value, but there are exceptions. */
115 #ifndef ASM_DECLARE_RESULT
116 #define ASM_DECLARE_RESULT(FILE, RESULT)
117 #endif
119 /* These macros generate the special .type and .size directives which
120 are used to set the corresponding fields of the linker symbol table
121 entries in an ELF object file under SVR4. These macros also output
122 the starting labels for the relevant functions/objects. */
124 /* Write the extra assembler code needed to declare a function properly.
125 Some svr4 assemblers need to also have something extra said about the
126 function's return value. We allow for that here. */
128 #undef ASM_DECLARE_FUNCTION_NAME
129 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
130 do { \
131 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
132 assemble_name (FILE, NAME); \
133 putc (',', FILE); \
134 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
135 putc ('\n', FILE); \
136 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
137 } while (0)
139 /* Write the extra assembler code needed to declare an object properly. */
141 #undef ASM_DECLARE_OBJECT_NAME
142 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
143 do { \
144 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
145 assemble_name (FILE, NAME); \
146 putc (',', FILE); \
147 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
148 putc ('\n', FILE); \
149 size_directive_output = 0; \
150 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
152 size_directive_output = 1; \
153 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
154 assemble_name (FILE, NAME); \
155 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
157 ASM_OUTPUT_LABEL(FILE, NAME); \
158 } while (0)
160 /* Output the size directive for a decl in rest_of_decl_compilation
161 in the case where we did not do so before the initializer.
162 Once we find the error_mark_node, we know that the value of
163 size_directive_output was set
164 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
166 #undef ASM_FINISH_DECLARE_OBJECT
167 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
168 do { \
169 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
170 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
171 && ! AT_END && TOP_LEVEL \
172 && DECL_INITIAL (DECL) == error_mark_node \
173 && !size_directive_output) \
175 size_directive_output = 1; \
176 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
177 assemble_name (FILE, name); \
178 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
180 } while (0)
182 /* This is how to declare the size of a function. */
184 #undef ASM_DECLARE_FUNCTION_SIZE
185 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
186 do { \
187 if (!flag_inhibit_size_directive) \
189 char label[256]; \
190 static int labelno; \
191 labelno++; \
192 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
193 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
194 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
195 assemble_name (FILE, (FNAME)); \
196 fprintf (FILE, ","); \
197 assemble_name (FILE, label); \
198 fprintf (FILE, "-"); \
199 assemble_name (FILE, (FNAME)); \
200 putc ('\n', FILE); \
202 } while (0)
205 A C statement to output something to the assembler file to switch to section
206 NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
207 NULL_TREE. Some target formats do not support arbitrary sections. Do not
208 define this macro in such cases.
210 #define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME, RELOC) \
211 do { \
212 extern FILE *asm_out_text_file; \
213 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
214 fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
215 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
216 fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME)); \
217 else \
218 fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \
219 } while (0)
221 /* Since gas and gld are standard on NetBSD, we don't need these */
222 #undef ASM_FINAL_SPEC
223 #undef STARTFILE_SPEC