]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/netbsd-elf.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / netbsd-elf.h
CommitLineData
4ace673e 1/* Common configuration file for NetBSD ELF targets.
f1717362 2 Copyright (C) 2002-2016 Free Software Foundation, Inc.
4ace673e 3 Contributed by Wasabi Systems, Inc.
4
187b36cf 5This file is part of GCC.
4ace673e 6
187b36cf 7GCC is free software; you can redistribute it and/or modify
4ace673e 8it under the terms of the GNU General Public License as published by
038d1e19 9the Free Software Foundation; either version 3, or (at your option)
4ace673e 10any later version.
11
187b36cf 12GCC is distributed in the hope that it will be useful,
4ace673e 13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
038d1e19 18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
4ace673e 20
65c9b105 21/* TARGET_OS_CPP_BUILTINS() common to all NetBSD ELF targets. */
22#define NETBSD_OS_CPP_BUILTINS_ELF() \
23 do \
24 { \
25 NETBSD_OS_CPP_BUILTINS_COMMON(); \
65c9b105 26 } \
27 while (0)
4ace673e 28
4ace673e 29/* Provide a STARTFILE_SPEC appropriate for NetBSD ELF. Here we
30 provide support for the special GCC option -static. On ELF
31 targets, we also add the crtbegin.o file, which provides part
32 of the support for getting C++ file-scope static objects
33 constructed before entering "main". */
34
9c7f893c 35#define NETBSD_STARTFILE_SPEC \
4ace673e 36 "%{!shared: \
37 %{pg:gcrt0%O%s} \
38 %{!pg: \
39 %{p:gcrt0%O%s} \
40 %{!p:crt0%O%s}}} \
c21b3276 41 %:if-exists(crti%O%s) \
68d74c02 42 %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
43 %{!static: \
44 %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}"
4ace673e 45
9c7f893c 46#undef STARTFILE_SPEC
47#define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
48
4ace673e 49
50/* Provide an ENDFILE_SPEC appropriate for NetBSD ELF. Here we
51 add crtend.o, which provides part of the support for getting
52 C++ file-scope static objects deconstructed after exiting "main". */
53
9c7f893c 54#define NETBSD_ENDFILE_SPEC \
c21b3276 55 "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
56 %:if-exists(crtn%O%s)"
4ace673e 57
9c7f893c 58#undef ENDFILE_SPEC
59#define ENDFILE_SPEC NETBSD_ENDFILE_SPEC
4ace673e 60
61/* Provide a LINK_SPEC appropriate for NetBSD ELF. Here we provide
62 support for the special GCC options -assert, -R, -rpath, -shared,
5d219ecb 63 -nostdlib, -static, -rdynamic, and -dynamic-linker.
64
65 Target-specific code can use this in conjunction with any other
66 target-specific LINK_SPEC options.
67
68 Target-specific code must provide the %(netbsd_entry_point) spec. */
69
70#define NETBSD_LINK_SPEC_ELF \
71 "%{assert*} %{R*} %{rpath*} \
72 %{shared:-shared} \
beb0dd83 73 %{symbolic:-Bsymbolic} \
5d219ecb 74 %{!shared: \
75 -dc -dp \
76 %{!nostdlib: \
66dc2261 77 %{!r: \
5d219ecb 78 %{!e*:-e %(netbsd_entry_point)}}} \
79 %{!static: \
80 %{rdynamic:-export-dynamic} \
7db2469c 81 -dynamic-linker /usr/libexec/ld.elf_so} \
4ace673e 82 %{static:-static}}"
d7b60d9d 83
84/* Use --as-needed -lgcc_s for eh support. */
85#ifdef HAVE_LD_AS_NEEDED
86#define USE_LD_AS_NEEDED 1
87#endif