* config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
[official-gcc.git] / gcc / config / i386 / netbsd-elf.h
blobb91847f7a4ad22b487ea333fe7d65089305424ba
1 /* Definitions of target machine for GNU compiler,
2 for i386/ELF NetBSD systems.
3 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4 Contributed by matthew green <mrg@eterna.com.au>
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #define TARGET_OS_CPP_BUILTINS() \
24 do \
25 { \
26 NETBSD_OS_CPP_BUILTINS_ELF(); \
27 } \
28 while (0)
30 /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target.
31 This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
32 the i386 target. */
34 #undef LINK_SPEC
35 #define LINK_SPEC \
36 "%{assert*} %{R*} \
37 %{shared:-shared} \
38 %{!shared: \
39 -dc -dp \
40 %{!nostdlib: \
41 %{!r*: \
42 %{!e*:-e __start}}} \
43 %{!static: \
44 %{rdynamic:-export-dynamic} \
45 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
46 %{static:-static}}"
48 #undef SUBTARGET_EXTRA_SPECS
49 #define SUBTARGET_EXTRA_SPECS \
50 { "netbsd_cpp_spec", NETBSD_CPP_SPEC },
52 /* Provide a CPP_SPEC appropriate for NetBSD. */
54 #undef CPP_SPEC
55 #define CPP_SPEC "%(cpp_cpu) %(netbsd_cpp_spec)"
58 /* Make gcc agree with <machine/ansi.h> */
60 #undef SIZE_TYPE
61 #define SIZE_TYPE "unsigned int"
63 #undef PTRDIFF_TYPE
64 #define PTRDIFF_TYPE "int"
66 #undef ASM_APP_ON
67 #define ASM_APP_ON "#APP\n"
69 #undef ASM_APP_OFF
70 #define ASM_APP_OFF "#NO_APP\n"
72 #undef ASM_FINAL_SPEC
74 #undef ASM_COMMENT_START
75 #define ASM_COMMENT_START "#"
77 #undef DBX_REGISTER_NUMBER
78 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
81 /* Output assembler code to FILE to call the profiler. */
83 #undef NO_PROFILE_COUNTERS
84 #define NO_PROFILE_COUNTERS
86 #undef FUNCTION_PROFILER
87 #define FUNCTION_PROFILER(FILE, LABELNO) \
88 { \
89 if (flag_pic) \
90 fprintf (FILE, "\tcall __mcount@PLT\n"); \
91 else \
92 fprintf (FILE, "\tcall __mcount\n"); \
96 #undef HAS_INIT_SECTION
98 /* This is how we tell the assembler that two symbols have the same value. */
100 #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
101 do { assemble_name(FILE, NAME1); \
102 fputs(" = ", FILE); \
103 assemble_name(FILE, NAME2); \
104 fputc('\n', FILE); } while (0)
106 /* A C statement to output to the stdio stream FILE an assembler
107 command to advance the location counter to a multiple of 1<<LOG
108 bytes if it is within MAX_SKIP bytes.
110 This is used to align code labels according to Intel recommendations. */
112 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
113 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
114 if ((LOG) != 0) { \
115 if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
116 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
118 #endif
120 /* We always use gas here, so we don't worry about ECOFF assembler
121 problems. */
122 #undef TARGET_GAS
123 #define TARGET_GAS 1
125 /* Default to pcc-struct-return, because this is the ELF abi and
126 we don't care about compatibility with older gcc versions. */
127 #define DEFAULT_PCC_STRUCT_RETURN 1
129 #define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF)");