OSDN Git Service

* config/freebsd.h (LIB_SPEC): Key the exact setting to
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / freebsd.h
1 /* Definitions for Intel 386 running FreeBSD with ELF format
2    Copyright (C) 1996, 2000 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 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 #undef TARGET_VERSION
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 SET_ASM_OP
39 #define SET_ASM_OP      "\t.set\t"
40
41 /* This is how to output an element of a case-vector that is relative.
42    This is only used for PIC code.  See comments by the `casesi' insn in
43    i386.md for an explanation of the expression this outputs. */
44 #undef ASM_OUTPUT_ADDR_DIFF_ELT
45 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
46   fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
47
48 /* Indicate that jump tables go in the text section.  This is
49    necessary when compiling PIC code.  */
50 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
51
52 #undef DBX_REGISTER_NUMBER
53 #define DBX_REGISTER_NUMBER(n) \
54   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
55
56 #undef  NO_PROFILE_COUNTERS
57 #define NO_PROFILE_COUNTERS
58
59 /* Tell final.c that we don't need a label passed to mcount.  */
60
61 #undef FUNCTION_PROFILER
62 #define FUNCTION_PROFILER(FILE, LABELNO)  \
63 {                                                                       \
64   if (flag_pic)                                                         \
65       fprintf ((FILE), "\tcall *.mcount@GOT(%%ebx)\n");                 \
66   else                                                                  \
67       fprintf ((FILE), "\tcall .mcount\n");                             \
68 }
69
70 /* Make gcc agree with <machine/ansi.h>.  */
71
72 #undef SIZE_TYPE
73 #define SIZE_TYPE "unsigned int"
74  
75 #undef PTRDIFF_TYPE
76 #define PTRDIFF_TYPE "int"
77   
78 #undef WCHAR_TYPE_SIZE
79 #define WCHAR_TYPE_SIZE BITS_PER_WORD
80     
81 /* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
82    the magical crtbegin.o file (see crtstuff.c) which provides part 
83         of the support for getting C++ file-scope static object constructed 
84         before entering `main'. */
85    
86 #undef  STARTFILE_SPEC
87 #define STARTFILE_SPEC \
88   "%{!shared: \
89      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
90                        %{!p:%{profile:gcrt1.o%s} \
91                          %{!profile:crt1.o%s}}}} \
92    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
93
94 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
95    the magical crtend.o file (see crtstuff.c) which provides part of 
96         the support for getting C++ file-scope static object constructed 
97         before entering `main', followed by a normal "finalizer" file, 
98         `crtn.o'.  */
99
100 #undef  ENDFILE_SPEC
101 #define ENDFILE_SPEC \
102   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
103
104 /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
105    for the special GCC options -static and -shared, which allow us to
106    link things in one of these three modes by applying the appropriate
107    combinations of options at link-time. We like to support here for
108    as many of the other GNU linker options as possible. But I don't
109    have the time to search for those flags. I am sure how to add
110    support for -soname shared_object_name. H.J.
111
112    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
113    -Wl,-V.
114
115    When the -shared link option is used a final link is not being
116    done.  */
117
118 #undef  LINK_SPEC
119 #define LINK_SPEC "-m elf_i386 \
120   %{Wl,*:%*} \
121   %{v:-V} \
122   %{assert*} %{R*} %{rpath*} %{defsym*} \
123   %{shared:-Bshareable %{h*} %{soname*}} \
124     %{!shared: \
125       %{!static: \
126         %{rdynamic:-export-dynamic} \
127         %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
128     %{static:-Bstatic}} \
129   %{symbolic:-Bsymbolic}"
130
131 /* A C statement to output to the stdio stream FILE an assembler
132    command to advance the location counter to a multiple of 1<<LOG
133    bytes if it is within MAX_SKIP bytes.
134
135    This is used to align code labels according to Intel recommendations.  */
136
137 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
138 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                  \
139   if ((LOG) != 0) {                                                                                                             \
140     if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));    \
141     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
142   }
143 #endif