2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / netbsd-elf.h
bloba87699c34a21de3f3979937d24edc04b77618bdd
1 /* Common configuration file for NetBSD ELF targets.
2 Copyright (C) 2002 Free Software Foundation, Inc.
3 Contributed by Wasabi Systems, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* TARGET_OS_CPP_BUILTINS() common to all NetBSD ELF targets. */
23 #define NETBSD_OS_CPP_BUILTINS_ELF() \
24 do \
25 { \
26 NETBSD_OS_CPP_BUILTINS_COMMON(); \
27 } \
28 while (0)
30 /* This defines which switch letters take arguments. On NetBSD, most
31 of the normal cases (defined by gcc.c) apply, and we also have -h*
32 and -z* options (for the linker) (coming from SVR4). */
34 #undef SWITCH_TAKES_ARG
35 #define SWITCH_TAKES_ARG(CHAR) \
36 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
37 || (CHAR) == 'h' \
38 || (CHAR) == 'z' \
39 || (CHAR) == 'R')
42 /* Provide a STARTFILE_SPEC appropriate for NetBSD ELF. Here we
43 provide support for the special GCC option -static. On ELF
44 targets, we also add the crtbegin.o file, which provides part
45 of the support for getting C++ file-scope static objects
46 constructed before entering "main". */
48 #define NETBSD_STARTFILE_SPEC \
49 "%{!shared: \
50 %{pg:gcrt0%O%s} \
51 %{!pg: \
52 %{p:gcrt0%O%s} \
53 %{!p:crt0%O%s}}} \
54 %:if-exists(crti%O%s) \
55 %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
56 %{!static: \
57 %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}"
59 #undef STARTFILE_SPEC
60 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
63 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF. Here we
64 add crtend.o, which provides part of the support for getting
65 C++ file-scope static objects deconstructed after exiting "main". */
67 #define NETBSD_ENDFILE_SPEC \
68 "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
69 %:if-exists(crtn%O%s)"
71 #undef ENDFILE_SPEC
72 #define ENDFILE_SPEC NETBSD_ENDFILE_SPEC
74 /* Provide a LINK_SPEC appropriate for NetBSD ELF. Here we provide
75 support for the special GCC options -assert, -R, -rpath, -shared,
76 -nostdlib, -static, -rdynamic, and -dynamic-linker.
78 Target-specific code can use this in conjunction with any other
79 target-specific LINK_SPEC options.
81 Target-specific code must provide the %(netbsd_entry_point) spec. */
83 #define NETBSD_LINK_SPEC_ELF \
84 "%{assert*} %{R*} %{rpath*} \
85 %{shared:-shared} \
86 %{!shared: \
87 -dc -dp \
88 %{!nostdlib: \
89 %{!r*: \
90 %{!e*:-e %(netbsd_entry_point)}}} \
91 %{!static: \
92 %{rdynamic:-export-dynamic} \
93 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
94 %{static:-static}}"