1 /* Definitions of target machine for GNU compiler. MIPS R3000 version with
2 GOFAST floating point library.
3 Copyright (C) 1994, 1997, 1999, 2000, 2002, 2003
4 Free Software Foundation, Inc.
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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 #define DBX_DEBUGGING_INFO 1
25 #define DWARF2_DEBUGGING_INFO 1
27 #undef PREFERRED_DEBUGGING_TYPE
28 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
30 #undef SUBTARGET_ASM_DEBUGGING_SPEC
31 #define SUBTARGET_ASM_DEBUGGING_SPEC "-g0"
33 /* Biggest alignment supported by the object file format of this
34 machine. Use this macro to limit the alignment which can be
35 specified using the `__attribute__ ((aligned (N)))' construct. If
36 not defined, the default value is `BIGGEST_ALIGNMENT'. */
38 #undef MAX_OFILE_ALIGNMENT
39 #define MAX_OFILE_ALIGNMENT (32768*8)
41 /* Switch into a generic section. */
42 #undef TARGET_ASM_NAMED_SECTION
43 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
45 /* The following macro defines the format used to output the second
46 operand of the .type assembler directive. Different svr4 assemblers
47 expect various different forms for this operand. The one given here
48 is just a default. You may need to override it in your machine-
49 specific tm.h file (depending upon the particulars of your assembler). */
51 #define TYPE_OPERAND_FMT "@%s"
53 /* Define the strings used for the special svr4 .type and .size directives.
54 These strings generally do not vary from one system running svr4 to
55 another, but if a given system (e.g. m88k running svr) needs to use
56 different pseudo-op names for these, they may be overridden in the
57 file which includes this one. */
61 #define TYPE_ASM_OP "\t.type\t"
62 #define SIZE_ASM_OP "\t.size\t"
64 /* If defined, a C expression whose value is a string containing the
65 assembler operation to identify the following data as
66 uninitialized global data. If not defined, and neither
67 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
68 uninitialized global data will be output in the data section if
69 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
72 #ifndef BSS_SECTION_ASM_OP
73 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
76 #undef SBSS_SECTION_ASM_OP
77 #define SBSS_SECTION_ASM_OP "\t.section .sbss"
79 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
80 separate, explicit argument. If you define this macro, it is used
81 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
82 handling the required alignment of the variable. The alignment is
83 specified as the number of bits.
85 Try to use function `asm_output_aligned_bss' defined in file
86 `varasm.c' when defining this macro. */
87 #ifndef ASM_OUTPUT_ALIGNED_BSS
88 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
90 if (SIZE > 0 && SIZE <= (unsigned HOST_WIDE_INT)mips_section_threshold)\
91 named_section (0, ".sbss", 0); \
94 ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
95 last_assemble_variable_decl = DECL; \
96 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
97 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
101 /* These macros generate the special .type and .size directives which
102 are used to set the corresponding fields of the linker symbol table
103 entries in an ELF object file under SVR4. These macros also output
104 the starting labels for the relevant functions/objects. */
106 /* Write the extra assembler code needed to declare an object properly. */
108 #undef ASM_DECLARE_OBJECT_NAME
109 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
111 HOST_WIDE_INT size; \
112 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
113 size_directive_output = 0; \
114 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
116 size_directive_output = 1; \
117 size = int_size_in_bytes (TREE_TYPE (DECL)); \
118 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
120 mips_declare_object (FILE, NAME, "", ":\n", 0); \
123 /* Output the size directive for a decl in rest_of_decl_compilation
124 in the case where we did not do so before the initializer.
125 Once we find the error_mark_node, we know that the value of
126 size_directive_output was set
127 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
129 #undef ASM_FINISH_DECLARE_OBJECT
130 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
132 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
133 HOST_WIDE_INT size; \
135 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
136 && ! AT_END && TOP_LEVEL \
137 && DECL_INITIAL (DECL) == error_mark_node \
138 && !size_directive_output) \
140 size_directive_output = 1; \
141 size = int_size_in_bytes (TREE_TYPE (DECL)); \
142 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
146 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
147 do { fputc ( '\t', FILE); \
148 assemble_name (FILE, LABEL1); \
149 fputs ( " = ", FILE); \
150 assemble_name (FILE, LABEL2); \
151 fputc ( '\n', FILE); \
154 /* Note about .weak vs. .weakext
155 The mips native assemblers support .weakext, but not .weak.
156 mips-elf gas supports .weak, but not .weakext.
157 mips-elf gas has been changed to support both .weak and .weakext,
158 but until that support is generally available, the 'if' below
161 #undef ASM_WEAKEN_LABEL
162 #define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
163 #define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
166 fputs ("\t.weak\t", FILE); \
168 fputs ("\t.weakext\t", FILE); \
169 assemble_name (FILE, NAME); \
173 assemble_name (FILE, VALUE); \
175 fputc ('\n', FILE); \
178 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
180 /* On elf, we *do* have support for the .init and .fini sections, and we
181 can put stuff in there to be executed before and after `main'. We let
182 crtstuff.c and other files know this by defining the following symbols.
183 The definitions say how to change sections to the .init and .fini
184 sections. This is the same for all known elf assemblers. */
186 #undef INIT_SECTION_ASM_OP
187 #define INIT_SECTION_ASM_OP "\t.section\t.init"
188 #undef FINI_SECTION_ASM_OP
189 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
191 /* Don't set the target flags, this is done by the linker script */
195 #undef STARTFILE_SPEC
196 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
199 #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
201 /* We support #pragma. */
202 #define HANDLE_SYSV_PRAGMA 1