1/* Definitions for Intel 386 running FreeBSD with ELF format
2   Copyright (C) 1996-2015 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
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 3, or (at your option)
13any later version.
14
15GCC is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with GCC; see the file COPYING3.  If not see
22<http://www.gnu.org/licenses/>.  */
23
24
25/* Override the default comment-starter of "/".  */
26#undef  ASM_COMMENT_START
27#define ASM_COMMENT_START "#"
28
29#undef  ASM_APP_ON
30#define ASM_APP_ON "#APP\n"
31
32#undef  ASM_APP_OFF
33#define ASM_APP_OFF "#NO_APP\n"
34
35#undef  DBX_REGISTER_NUMBER
36#define DBX_REGISTER_NUMBER(n) \
37  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
38
39#undef  NO_PROFILE_COUNTERS
40#define NO_PROFILE_COUNTERS	1
41
42/* Tell final.c that we don't need a label passed to mcount.  */
43
44#undef  MCOUNT_NAME
45#define MCOUNT_NAME ".mcount"
46
47/* Make gcc agree with <machine/ansi.h>.  */
48
49#undef  SIZE_TYPE
50#define SIZE_TYPE	(TARGET_64BIT ? "long unsigned int" : "unsigned int")
51
52#undef  PTRDIFF_TYPE
53#define PTRDIFF_TYPE	(TARGET_64BIT ? "long int" : "int")
54
55#undef  WCHAR_TYPE_SIZE
56#define WCHAR_TYPE_SIZE	(TARGET_64BIT ? 32 : BITS_PER_WORD)
57
58#undef  SUBTARGET_EXTRA_SPECS	/* i386.h bogusly defines it.  */
59#define SUBTARGET_EXTRA_SPECS \
60  { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
61
62/* Use the STARTFILE_SPEC from config/freebsd-spec.h.  */
63
64#undef  STARTFILE_SPEC
65#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
66
67/* Use the ENDFILE_SPEC from config/freebsd-spec.h.  */
68
69#undef  ENDFILE_SPEC
70#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
71
72/* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
73   for the special GCC options -static and -shared, which allow us to
74   link things in one of these three modes by applying the appropriate
75   combinations of options at link-time.
76
77   When the -shared link option is used a final link is not being
78   done.  */
79
80#undef	LINK_SPEC
81#define LINK_SPEC "\
82  %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
83  %{v:-V} \
84  %{assert*} %{R*} %{rpath*} %{defsym*} \
85  %{shared:-Bshareable %{h*} %{soname*}} \
86    %{!shared: \
87      %{!static: \
88        %{rdynamic:-export-dynamic} \
89        -dynamic-linker %(fbsd_dynamic_linker) } \
90    %{static:-Bstatic}} \
91  %{symbolic:-Bsymbolic}"
92
93/* A C statement to output to the stdio stream FILE an assembler
94   command to advance the location counter to a multiple of 1<<LOG
95   bytes if it is within MAX_SKIP bytes.
96
97   This is used to align code labels according to Intel recommendations.  */
98
99#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
100#undef  ASM_OUTPUT_MAX_SKIP_ALIGN
101#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
102  do {									\
103    if ((LOG) != 0) {							\
104      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));	\
105      else {								\
106	fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
107	/* Make sure that we have at least 8 byte alignment if > 8 byte \
108	   alignment is preferred.  */					\
109	if ((LOG) > 3							\
110	    && (1 << (LOG)) > ((MAX_SKIP) + 1)				\
111	    && (MAX_SKIP) >= 7)						\
112	  fputs ("\t.p2align 3\n", (FILE));				\
113      }									\
114    }									\
115  } while (0)
116#endif
117
118/* Don't default to pcc-struct-return, we want to retain compatibility with
119   older gcc versions AND pcc-struct-return is nonreentrant.
120   (even though the SVR4 ABI for the i386 says that records and unions are
121   returned in memory).  */
122
123#undef  DEFAULT_PCC_STRUCT_RETURN
124#define DEFAULT_PCC_STRUCT_RETURN 0
125
126/* FreeBSD sets the rounding precision of the FPU to 53 bits.  Let the
127   compiler get the contents of <float.h> and std::numeric_limits correct.  */
128#undef TARGET_96_ROUND_53_LONG_DOUBLE
129#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
130
131/* Static stack checking is supported by means of probes.  */
132#define STACK_CHECK_STATIC_BUILTIN 1
133
134#define SUBTARGET32_DEFAULT_CPU "i586"
135
136#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
137
138