This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / config / mips / elf.h
blobff70b59cc20b35786cd55cf878362b4f2e1676cf
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, 2004
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC 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.
13 GCC 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 GCC; 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 /* Biggest alignment supported by the object file format of this
24 machine. Use this macro to limit the alignment which can be
25 specified using the `__attribute__ ((aligned (N)))' construct. If
26 not defined, the default value is `BIGGEST_ALIGNMENT'. */
28 #undef MAX_OFILE_ALIGNMENT
29 #define MAX_OFILE_ALIGNMENT (32768*8)
31 /* Switch into a generic section. */
32 #undef TARGET_ASM_NAMED_SECTION
33 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
35 /* The following macro defines the format used to output the second
36 operand of the .type assembler directive. Different svr4 assemblers
37 expect various different forms for this operand. The one given here
38 is just a default. You may need to override it in your machine-
39 specific tm.h file (depending upon the particulars of your assembler). */
41 #define TYPE_OPERAND_FMT "@%s"
43 /* Define the strings used for the special svr4 .type and .size directives.
44 These strings generally do not vary from one system running svr4 to
45 another, but if a given system (e.g. m88k running svr) needs to use
46 different pseudo-op names for these, they may be overridden in the
47 file which includes this one. */
49 #undef TYPE_ASM_OP
50 #undef SIZE_ASM_OP
51 #define TYPE_ASM_OP "\t.type\t"
52 #define SIZE_ASM_OP "\t.size\t"
54 /* If defined, a C expression whose value is a string containing the
55 assembler operation to identify the following data as
56 uninitialized global data. If not defined, and neither
57 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
58 uninitialized global data will be output in the data section if
59 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
60 used. */
62 #ifndef BSS_SECTION_ASM_OP
63 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
64 #endif
66 #ifndef ASM_OUTPUT_ALIGNED_BSS
67 #define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss
68 #endif
70 #undef ASM_DECLARE_OBJECT_NAME
71 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
73 #undef ASM_FINISH_DECLARE_OBJECT
74 #define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
76 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
77 do { fputc ( '\t', FILE); \
78 assemble_name (FILE, LABEL1); \
79 fputs ( " = ", FILE); \
80 assemble_name (FILE, LABEL2); \
81 fputc ( '\n', FILE); \
82 } while (0)
84 /* Note about .weak vs. .weakext
85 The mips native assemblers support .weakext, but not .weak.
86 mips-elf gas supports .weak, but not .weakext.
87 mips-elf gas has been changed to support both .weak and .weakext,
88 but until that support is generally available, the 'if' below
89 should serve. */
91 #undef ASM_WEAKEN_LABEL
92 #define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
93 #define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
94 do { \
95 if (TARGET_GAS) \
96 fputs ("\t.weak\t", FILE); \
97 else \
98 fputs ("\t.weakext\t", FILE); \
99 assemble_name (FILE, NAME); \
100 if (VALUE) \
102 fputc (' ', FILE); \
103 assemble_name (FILE, VALUE); \
105 fputc ('\n', FILE); \
106 } while (0)
108 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
110 /* On elf, we *do* have support for the .init and .fini sections, and we
111 can put stuff in there to be executed before and after `main'. We let
112 crtstuff.c and other files know this by defining the following symbols.
113 The definitions say how to change sections to the .init and .fini
114 sections. This is the same for all known elf assemblers. */
116 #undef INIT_SECTION_ASM_OP
117 #define INIT_SECTION_ASM_OP "\t.section\t.init"
118 #undef FINI_SECTION_ASM_OP
119 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
121 /* Don't set the target flags, this is done by the linker script */
122 #undef LIB_SPEC
123 #define LIB_SPEC ""
125 #undef STARTFILE_SPEC
126 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
128 #undef ENDFILE_SPEC
129 #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
131 /* We support #pragma. */
132 #define HANDLE_SYSV_PRAGMA 1