OSDN Git Service

* config/h8300/h8300.c (h8300_emit_stack_adjustment): Fix a
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / freebsd.h
1 /* Definitions for Intel 386 running FreeBSD with ELF format
2    Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
3    Contributed by Eric Youngdale.
4    Modified for stabs-in-ELF by H.J. Lu.
5    Adapted from GNU/Linux version by John Polstra.
6    Continued development by David O'Brien <obrien@freebsd.org>
7
8 This file is part of GCC.
9
10 GCC 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 GCC 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 GCC; 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
26 #define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
27
28 /* Override the default comment-starter of "/".  */
29 #undef  ASM_COMMENT_START
30 #define ASM_COMMENT_START "#"
31
32 #undef  ASM_APP_ON
33 #define ASM_APP_ON "#APP\n"
34
35 #undef  ASM_APP_OFF
36 #define ASM_APP_OFF "#NO_APP\n"
37
38 #undef  DBX_REGISTER_NUMBER
39 #define DBX_REGISTER_NUMBER(n) \
40   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
41
42 #undef  NO_PROFILE_COUNTERS
43 #define NO_PROFILE_COUNTERS     1
44
45 /* Tell final.c that we don't need a label passed to mcount.  */
46
47 #undef  MCOUNT_NAME
48 #define MCOUNT_NAME ".mcount"
49
50 /* Make gcc agree with <machine/ansi.h>.  */
51
52 #undef  SIZE_TYPE
53 #define SIZE_TYPE       (TARGET_64BIT ? "long unsigned int" : "unsigned int")
54  
55 #undef  PTRDIFF_TYPE
56 #define PTRDIFF_TYPE    (TARGET_64BIT ? "long int" : "int")
57   
58 #undef  WCHAR_TYPE_SIZE
59 #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
60     
61 /* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
62    the magical crtbegin.o file (see crtstuff.c) which provides part 
63         of the support for getting C++ file-scope static object constructed 
64         before entering `main'.  */
65    
66 #undef  STARTFILE_SPEC
67 #define STARTFILE_SPEC \
68   "%{!shared: \
69      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
70                        %{!p:%{profile:gcrt1.o%s} \
71                          %{!profile:crt1.o%s}}}} \
72    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
73
74 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
75    the magical crtend.o file (see crtstuff.c) which provides part of 
76         the support for getting C++ file-scope static object constructed 
77         before entering `main', followed by a normal "finalizer" file, 
78         `crtn.o'.  */
79
80 #undef  ENDFILE_SPEC
81 #define ENDFILE_SPEC \
82   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
83
84 /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
85    for the special GCC options -static and -shared, which allow us to
86    link things in one of these three modes by applying the appropriate
87    combinations of options at link-time. We like to support here for
88    as many of the other GNU linker options as possible. But I don't
89    have the time to search for those flags. I am sure how to add
90    support for -soname shared_object_name. H.J.
91
92    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
93    -Wl,-V.
94
95    When the -shared link option is used a final link is not being
96    done.  */
97
98 #undef  LINK_SPEC
99 #define LINK_SPEC "\
100   %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
101   %{Wl,*:%*} \
102   %{v:-V} \
103   %{assert*} %{R*} %{rpath*} %{defsym*} \
104   %{shared:-Bshareable %{h*} %{soname*}} \
105     %{!shared: \
106       %{!static: \
107         %{rdynamic:-export-dynamic} \
108         %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
109     %{static:-Bstatic}} \
110   %{symbolic:-Bsymbolic}"
111
112 /* A C statement to output to the stdio stream FILE an assembler
113    command to advance the location counter to a multiple of 1<<LOG
114    bytes if it is within MAX_SKIP bytes.
115
116    This is used to align code labels according to Intel recommendations.  */
117
118 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
119 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
120 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                  \
121   if ((LOG) != 0) {                                                                                                             \
122     if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));    \
123     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
124   }
125 #endif
126
127 /* Don't default to pcc-struct-return, we want to retain compatibility with
128    older gcc versions AND pcc-struct-return is nonreentrant.
129    (even though the SVR4 ABI for the i386 says that records and unions are
130    returned in memory).  */
131
132 #undef  DEFAULT_PCC_STRUCT_RETURN
133 #define DEFAULT_PCC_STRUCT_RETURN 0
134
135 /* FreeBSD sets the rounding precision of the FPU to 53 bits.  Let the
136    compiler get the contents of <float.h> and std::numeric_limits correct.  */
137 #define SUBTARGET_OVERRIDE_OPTIONS                      \
138   do {                                                  \
139     if (!TARGET_64BIT) {                                \
140       REAL_MODE_FORMAT (XFmode)                         \
141         = &ieee_extended_intel_96_round_53_format;      \
142       REAL_MODE_FORMAT (TFmode)                         \
143         = &ieee_extended_intel_96_round_53_format;      \
144     }                                                   \
145   } while (0)