]>
gcc.gnu.org Git - gcc.git/blob - gcc/config/mips/elf64.h
1 /* Definitions of target machine for GNU compiler. MIPS R4000 version with
2 GOFAST floating point library.
3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002
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. */
23 #define OBJECT_FORMAT_ELF
25 /* Default to -mips3. */
26 #ifndef TARGET_DEFAULT
27 #define TARGET_DEFAULT MASK_FLOAT64|MASK_64BIT
30 #ifndef MIPS_ISA_DEFAULT
31 #define MIPS_ISA_DEFAULT 3
34 /* This should change to n32 when it is supported in gas. */
35 #ifndef MIPS_ABI_DEFAULT
36 #define MIPS_ABI_DEFAULT ABI_O64
39 /* Until we figure out what MIPS ELF targets normally use, just do
41 #ifndef PREFERRED_DEBUGGING_TYPE
42 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
45 /* US Software GOFAST library support. */
47 #define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS
49 #include "mips/mips.h"
51 /* Use memcpy, et. al., rather than bcopy. */
52 #define TARGET_MEM_FUNCTIONS
54 /* Biggest alignment supported by the object file format of this
55 machine. Use this macro to limit the alignment which can be
56 specified using the `__attribute__ ((aligned (N)))' construct. If
57 not defined, the default value is `BIGGEST_ALIGNMENT'. */
59 #undef MAX_OFILE_ALIGNMENT
60 #define MAX_OFILE_ALIGNMENT (32768*8)
62 /* We need to use .esize and .etype instead of .size and .type to
63 avoid conflicting with ELF directives. */
65 #define PUT_SDB_SIZE(a) \
67 extern FILE *asm_out_text_file; \
68 fprintf (asm_out_text_file, "\t.esize\t"); \
69 fprintf (asm_out_text_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) (a)); \
70 fprintf (asm_out_text_file, ";"); \
74 #define PUT_SDB_TYPE(a) \
76 extern FILE *asm_out_text_file; \
77 fprintf (asm_out_text_file, "\t.etype\t0x%x;", (a)); \
80 /* Switch into a generic section. */
81 #undef TARGET_ASM_NAMED_SECTION
82 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
84 /* Given that Irix has it's own headers, not having TARGET_GAS here
85 seems a mistake. If we actually need to be prepared for file
86 switching, then we need a custom TARGET_ASM_NAMED_SECTION too. */
89 #define TEXT_SECTION() \
91 if (TARGET_FILE_SWITCHING) \
93 fputs (TEXT_SECTION_ASM_OP, asm_out_file); \
94 fputc ('\n', asm_out_file); \
97 /* The following macro defines the format used to output the second
98 operand of the .type assembler directive. Different svr4 assemblers
99 expect various different forms for this operand. The one given here
100 is just a default. You may need to override it in your machine-
101 specific tm.h file (depending upon the particulars of your assembler). */
103 #define TYPE_OPERAND_FMT "@%s"
105 /* Define the strings used for the special svr4 .type and .size directives.
106 These strings generally do not vary from one system running svr4 to
107 another, but if a given system (e.g. m88k running svr) needs to use
108 different pseudo-op names for these, they may be overridden in the
109 file which includes this one. */
113 #define TYPE_ASM_OP "\t.type\t"
114 #define SIZE_ASM_OP "\t.size\t"
116 /* These macros generate the special .type and .size directives which
117 are used to set the corresponding fields of the linker symbol table
118 entries in an ELF object file under SVR4. These macros also output
119 the starting labels for the relevant functions/objects. */
121 /* Write the extra assembler code needed to declare an object properly. */
123 #undef ASM_DECLARE_OBJECT_NAME
124 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
126 fprintf (FILE, "%s", TYPE_ASM_OP); \
127 assemble_name (FILE, NAME); \
129 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
131 size_directive_output = 0; \
132 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
134 size_directive_output = 1; \
135 fprintf (FILE, "%s", SIZE_ASM_OP); \
136 assemble_name (FILE, NAME); \
137 fprintf (FILE, ","); \
138 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
139 int_size_in_bytes (TREE_TYPE (DECL))); \
140 fprintf (FILE, "\n"); \
142 mips_declare_object (FILE, NAME, "", ":\n", 0); \
145 /* Output the size directive for a decl in rest_of_decl_compilation
146 in the case where we did not do so before the initializer.
147 Once we find the error_mark_node, we know that the value of
148 size_directive_output was set
149 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
151 #undef ASM_FINISH_DECLARE_OBJECT
152 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
154 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
155 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
156 && ! AT_END && TOP_LEVEL \
157 && DECL_INITIAL (DECL) == error_mark_node \
158 && !size_directive_output) \
160 size_directive_output = 1; \
161 fprintf (FILE, "%s", SIZE_ASM_OP); \
162 assemble_name (FILE, name); \
163 fprintf (FILE, ","); \
164 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
165 int_size_in_bytes (TREE_TYPE (DECL))); \
166 fprintf (FILE, "\n"); \
170 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
171 do { fputc ( '\t', FILE); \
172 assemble_name (FILE, LABEL1); \
173 fputs ( " = ", FILE); \
174 assemble_name (FILE, LABEL2); \
175 fputc ( '\n', FILE); \
178 /* Note about .weak vs. .weakext
179 The mips native assemblers support .weakext, but not .weak.
180 mips-elf gas supports .weak, but not .weakext.
181 mips-elf gas has been changed to support both .weak and .weakext,
182 but until that support is generally available, the 'if' below
185 #undef ASM_WEAKEN_LABEL
186 #define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
187 #define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
190 fputs ("\t.weak\t", FILE); \
192 fputs ("\t.weakext\t", FILE); \
193 assemble_name (FILE, NAME); \
197 assemble_name (FILE, VALUE); \
199 fputc ('\n', FILE); \
202 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
204 #define TARGET_ASM_UNIQUE_SECTION mips_unique_section
206 /* A list of other sections which the compiler might be "in" at any
208 #undef EXTRA_SECTIONS
209 #define EXTRA_SECTIONS in_sdata
211 #undef EXTRA_SECTION_FUNCTIONS
212 #define EXTRA_SECTION_FUNCTIONS \
213 SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
215 #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
218 if (in_section != ENUM) \
220 fprintf (asm_out_file, "%s\n", OP); \
225 /* On elf, we *do* have support for the .init and .fini sections, and we
226 can put stuff in there to be executed before and after `main'. We let
227 crtstuff.c and other files know this by defining the following symbols.
228 The definitions say how to change sections to the .init and .fini
229 sections. This is the same for all known elf assemblers. */
231 #undef INIT_SECTION_ASM_OP
232 #define INIT_SECTION_ASM_OP "\t.section\t.init"
233 #undef FINI_SECTION_ASM_OP
234 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
236 /* Don't set the target flags, this is done by the linker script */
240 #undef STARTFILE_SPEC
241 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0:crt0%O%s}"
244 #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
This page took 0.049988 seconds and 6 git commands to generate.