]>
Commit | Line | Data |
---|---|---|
41e5a1f5 | 1 | /* Definitions for Intel 386 running FreeBSD with ELF format |
2f83c7d6 | 2 | Copyright (C) 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc. |
41e5a1f5 DB |
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> | |
0e3ce1df | 7 | |
e20285ad | 8 | This file is part of GCC. |
0e3ce1df | 9 | |
e20285ad | 10 | GCC is free software; you can redistribute it and/or modify |
0e3ce1df | 11 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 12 | the Free Software Foundation; either version 3, or (at your option) |
0e3ce1df RK |
13 | any later version. |
14 | ||
e20285ad | 15 | GCC is distributed in the hope that it will be useful, |
0e3ce1df RK |
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 | |
2f83c7d6 NC |
21 | along with GCC; see the file COPYING3. If not see |
22 | <http://www.gnu.org/licenses/>. */ | |
0e3ce1df | 23 | |
39ed301b | 24 | |
41e5a1f5 | 25 | #define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); |
0e3ce1df | 26 | |
6981eacf | 27 | /* Override the default comment-starter of "/". */ |
8634e925 | 28 | #undef ASM_COMMENT_START |
6981eacf JL |
29 | #define ASM_COMMENT_START "#" |
30 | ||
8634e925 | 31 | #undef ASM_APP_ON |
0e3ce1df RK |
32 | #define ASM_APP_ON "#APP\n" |
33 | ||
8634e925 | 34 | #undef ASM_APP_OFF |
0e3ce1df | 35 | #define ASM_APP_OFF "#NO_APP\n" |
56f28b73 | 36 | |
8634e925 | 37 | #undef DBX_REGISTER_NUMBER |
0f7fa3d0 JH |
38 | #define DBX_REGISTER_NUMBER(n) \ |
39 | (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) | |
41e5a1f5 | 40 | |
618ec0d7 | 41 | #undef NO_PROFILE_COUNTERS |
9739c90c | 42 | #define NO_PROFILE_COUNTERS 1 |
618ec0d7 | 43 | |
41e5a1f5 | 44 | /* Tell final.c that we don't need a label passed to mcount. */ |
0e3ce1df | 45 | |
8634e925 | 46 | #undef MCOUNT_NAME |
a5fa1ecd | 47 | #define MCOUNT_NAME ".mcount" |
0e3ce1df | 48 | |
41e5a1f5 | 49 | /* Make gcc agree with <machine/ansi.h>. */ |
0e3ce1df | 50 | |
8634e925 | 51 | #undef SIZE_TYPE |
04b379ba | 52 | #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") |
41e5a1f5 | 53 | |
8634e925 | 54 | #undef PTRDIFF_TYPE |
04b379ba | 55 | #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") |
41e5a1f5 | 56 | |
8634e925 | 57 | #undef WCHAR_TYPE_SIZE |
04b379ba | 58 | #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD) |
2de2f846 DB |
59 | |
60 | #undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ | |
61 | #define SUBTARGET_EXTRA_SPECS \ | |
62 | { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } | |
41e5a1f5 | 63 | |
41e5a1f5 DB |
64 | /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add |
65 | the magical crtbegin.o file (see crtstuff.c) which provides part | |
66 | of the support for getting C++ file-scope static object constructed | |
892a2d68 | 67 | before entering `main'. */ |
41e5a1f5 DB |
68 | |
69 | #undef STARTFILE_SPEC | |
70 | #define STARTFILE_SPEC \ | |
71 | "%{!shared: \ | |
72 | %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ | |
73 | %{!p:%{profile:gcrt1.o%s} \ | |
74 | %{!profile:crt1.o%s}}}} \ | |
75 | crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
76 | ||
77 | /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on | |
78 | the magical crtend.o file (see crtstuff.c) which provides part of | |
79 | the support for getting C++ file-scope static object constructed | |
80 | before entering `main', followed by a normal "finalizer" file, | |
81 | `crtn.o'. */ | |
82 | ||
83 | #undef ENDFILE_SPEC | |
84 | #define ENDFILE_SPEC \ | |
85 | "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" | |
86 | ||
87 | /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support | |
88 | for the special GCC options -static and -shared, which allow us to | |
89 | link things in one of these three modes by applying the appropriate | |
90 | combinations of options at link-time. We like to support here for | |
91 | as many of the other GNU linker options as possible. But I don't | |
92 | have the time to search for those flags. I am sure how to add | |
93 | support for -soname shared_object_name. H.J. | |
94 | ||
95 | I took out %{v:%{!V:-V}}. It is too much :-(. They can use | |
96 | -Wl,-V. | |
97 | ||
98 | When the -shared link option is used a final link is not being | |
99 | done. */ | |
100 | ||
101 | #undef LINK_SPEC | |
54e20385 | 102 | #define LINK_SPEC "\ |
8f37dd98 | 103 | %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ |
41e5a1f5 DB |
104 | %{v:-V} \ |
105 | %{assert*} %{R*} %{rpath*} %{defsym*} \ | |
106 | %{shared:-Bshareable %{h*} %{soname*}} \ | |
107 | %{!shared: \ | |
108 | %{!static: \ | |
109 | %{rdynamic:-export-dynamic} \ | |
2de2f846 | 110 | %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ |
41e5a1f5 DB |
111 | %{static:-Bstatic}} \ |
112 | %{symbolic:-Bsymbolic}" | |
113 | ||
114 | /* A C statement to output to the stdio stream FILE an assembler | |
115 | command to advance the location counter to a multiple of 1<<LOG | |
116 | bytes if it is within MAX_SKIP bytes. | |
117 | ||
118 | This is used to align code labels according to Intel recommendations. */ | |
119 | ||
120 | #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN | |
9e68a9dc | 121 | #undef ASM_OUTPUT_MAX_SKIP_ALIGN |
41e5a1f5 DB |
122 | #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \ |
123 | if ((LOG) != 0) { \ | |
124 | if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ | |
125 | else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ | |
126 | } | |
0e3ce1df | 127 | #endif |
d360fd18 DB |
128 | |
129 | /* Don't default to pcc-struct-return, we want to retain compatibility with | |
130 | older gcc versions AND pcc-struct-return is nonreentrant. | |
131 | (even though the SVR4 ABI for the i386 says that records and unions are | |
132 | returned in memory). */ | |
133 | ||
134 | #undef DEFAULT_PCC_STRUCT_RETURN | |
135 | #define DEFAULT_PCC_STRUCT_RETURN 0 | |
bfa0c519 RH |
136 | |
137 | /* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the | |
138 | compiler get the contents of <float.h> and std::numeric_limits correct. */ | |
cc69336f RH |
139 | #undef TARGET_96_ROUND_53_LONG_DOUBLE |
140 | #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) | |
2de710b9 | 141 | |
282ac51f UB |
142 | /* Put all *tf routines in libgcc. */ |
143 | #undef LIBGCC2_HAS_TF_MODE | |
144 | #define LIBGCC2_HAS_TF_MODE 1 | |
145 | #define LIBGCC2_TF_CEXT q | |
146 | #define TF_SIZE 113 | |
147 | ||
2de710b9 EB |
148 | /* Static stack checking is supported by means of probes. */ |
149 | #define STACK_CHECK_STATIC_BUILTIN 1 |