OSDN Git Service

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