OSDN Git Service

Two little fixes I commited to classpath but not to libgcj first
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / freebsd-aout.h
1 /* Definitions of target machine for GNU compiler for Intel 80386
2    running FreeBSD.
3    Copyright (C) 1988, 1992, 1994, 1996, 1997, 1999, 2000, 2002, 2003
4    Free Software Foundation, Inc.
5    Contributed by Poul-Henning Kamp <phk@login.dkuug.dk>
6    Continued development by David O'Brien <obrien@NUXI.org>
7
8 This file is part of GNU CC.
9
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
14
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING.  If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA.  */
24
25 /* Don't assume anything about the header files.  */
26 #define NO_IMPLICIT_EXTERN_C
27
28 /* This goes away when the math-emulator is fixed */
29 #undef TARGET_SUBTARGET_DEFAULT
30 #define TARGET_SUBTARGET_DEFAULT \
31   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
32
33 /* The macro defined in i386.h doesn't work with the old gas of
34    FreeBSD 2.x.  The definition in sco.h and sol2.h appears to work,
35    but it turns out that, even though the assembler doesn't complain,
36    we get incorrect results.  Fortunately, the definition in
37    defaults.h works.  */
38 #undef ASM_PREFERRED_EH_DATA_FORMAT
39
40 #define TARGET_OS_CPP_BUILTINS()                \
41   do                                            \
42     {                                           \
43         builtin_define_std ("unix");            \
44         builtin_define ("__FreeBSD__");         \
45         builtin_assert ("system=unix");         \
46         builtin_assert ("system=bsd");          \
47         builtin_assert ("system=FreeBSD");      \
48     }                                           \
49   while (0)
50
51 /* Like the default, except no -lg.  */
52 #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
53
54 #undef SIZE_TYPE
55 #define SIZE_TYPE "unsigned int"
56
57 #undef PTRDIFF_TYPE
58 #define PTRDIFF_TYPE "int"
59
60 #undef WCHAR_TYPE
61 #define WCHAR_TYPE "int"
62
63 #undef WCHAR_TYPE_SIZE
64 #define WCHAR_TYPE_SIZE BITS_PER_WORD
65
66 /* Override the default comment-starter of "/".  */
67
68 #undef ASM_COMMENT_START
69 #define ASM_COMMENT_START "#"
70
71 #undef ASM_APP_ON
72 #define ASM_APP_ON "#APP\n"
73
74 #undef ASM_APP_OFF
75 #define ASM_APP_OFF "#NO_APP\n"
76
77 /* FreeBSD using a.out does not support DWARF2 unwinding mechanisms.  */
78 #define DWARF2_UNWIND_INFO 0
79 \f
80 /* Don't default to pcc-struct-return, because in FreeBSD we prefer the
81    superior nature of the older gcc way.  */
82 #define DEFAULT_PCC_STRUCT_RETURN 0
83
84 /* Ensure we the configuration knows our system correctly so we can link with
85    libraries compiled with the native cc.  */
86 #undef NO_DOLLAR_IN_LABEL
87 \f
88 /* i386 freebsd still uses old binutils that don't insert nops by default
89    when the .align directive demands to insert extra space in the text
90    segment.  */
91 #undef ASM_OUTPUT_ALIGN
92 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
93   if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
94 \f
95 /* Profiling routines, partially copied from i386/osfrose.h.  */
96
97 #undef MCOUNT_NAME
98 #define MCOUNT_NAME "mcount"
99 #undef PROFILE_COUNT_REGISTER
100 #define PROFILE_COUNT_REGISTER "eax"
101
102 /*
103  * Some imports from svr4.h in support of shared libraries.
104  * Currently, we need the DECLARE_OBJECT_SIZE stuff.
105  */
106
107 /* Define the strings used for the special svr4 .type and .size directives.
108    These strings generally do not vary from one system running svr4 to
109    another, but if a given system (e.g. m88k running svr) needs to use
110    different pseudo-op names for these, they may be overridden in the
111    file which includes this one.  */
112
113 #define TYPE_ASM_OP     "\t.type\t"
114 #define SIZE_ASM_OP     "\t.size\t"
115
116 /* The following macro defines the format used to output the second
117    operand of the .type assembler directive.  Different svr4 assemblers
118    expect various different forms for this operand.  The one given here
119    is just a default.  You may need to override it in your machine-
120    specific tm.h file (depending upon the particulars of your assembler).  */
121
122 #define TYPE_OPERAND_FMT        "@%s"
123
124 /* Write the extra assembler code needed to declare a function's result.
125    Most svr4 assemblers don't require any special declaration of the
126    result value, but there are exceptions.  */
127
128 #ifndef ASM_DECLARE_RESULT
129 #define ASM_DECLARE_RESULT(FILE, RESULT)
130 #endif
131
132 /* These macros generate the special .type and .size directives which
133    are used to set the corresponding fields of the linker symbol table
134    entries in an ELF object file under SVR4.  These macros also output
135    the starting labels for the relevant functions/objects.  */
136
137 /* Write the extra assembler code needed to declare a function properly.
138    Some svr4 assemblers need to also have something extra said about the
139    function's return value.  We allow for that here.  */
140
141 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)             \
142   do                                                            \
143     {                                                           \
144       ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");       \
145       ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));            \
146       ASM_OUTPUT_LABEL (FILE, NAME);                            \
147     }                                                           \
148   while (0)
149
150 /* Write the extra assembler code needed to declare an object properly.  */
151
152 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)               \
153   do                                                            \
154     {                                                           \
155       HOST_WIDE_INT size;                                       \
156                                                                 \
157       ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");         \
158                                                                 \
159       size_directive_output = 0;                                \
160       if (!flag_inhibit_size_directive                          \
161           && (DECL) && DECL_SIZE (DECL))                        \
162         {                                                       \
163           size_directive_output = 1;                            \
164           size = int_size_in_bytes (TREE_TYPE (DECL));          \
165           ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);         \
166         }                                                       \
167                                                                 \
168       ASM_OUTPUT_LABEL (FILE, NAME);                            \
169     }                                                           \
170   while (0)
171
172 /* Output the size directive for a decl in rest_of_decl_compilation
173    in the case where we did not do so before the initializer.
174    Once we find the error_mark_node, we know that the value of
175    size_directive_output was set
176    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
177
178 #undef ASM_FINISH_DECLARE_OBJECT
179 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)        \
180 do {                                                                    \
181      const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);            \
182      HOST_WIDE_INT size;                                                \
183      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)               \
184          && ! AT_END && TOP_LEVEL                                       \
185          && DECL_INITIAL (DECL) == error_mark_node                      \
186          && !size_directive_output)                                     \
187        {                                                                \
188          size_directive_output = 1;                                     \
189          size = int_size_in_bytes (TREE_TYPE (DECL));                   \
190          ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                  \
191        }                                                                \
192    } while (0)
193
194 /* This is how to declare the size of a function.  */
195
196 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
197   do {                                                                  \
198     if (!flag_inhibit_size_directive)                                   \
199       ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                           \
200   } while (0)
201
202 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
203 #define ASM_SPEC   "%{fpic:-k} %{fPIC:-k}"
204 #define LINK_SPEC \
205   "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
206    %{shared:-Bshareable} \
207    %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
208    %{pg:-Bstatic} %{Z}} \
209    %{assert*} %{R*}"
210
211 #define STARTFILE_SPEC  \
212   "%{shared:c++rt0.o%s} \
213    %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
214
215 /* Define this so we can compile MS code for use with WINE.  */
216 #define HANDLE_PRAGMA_PACK_PUSH_POP
217
218 /* FreeBSD 2.2.7's assembler does not support .quad properly.  Do not
219    use it.  */
220 #undef ASM_QUAD