comparison gcc/config/netbsd-elf.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Common configuration file for NetBSD ELF targets. 1 /* Common configuration file for NetBSD ELF targets.
2 Copyright (C) 2002-2018 Free Software Foundation, Inc. 2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
3 Contributed by Wasabi Systems, Inc. 3 Contributed by Wasabi Systems, Inc.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
38 %{!pg: \ 38 %{!pg: \
39 %{p:gcrt0%O%s} \ 39 %{p:gcrt0%O%s} \
40 %{!p:crt0%O%s}}} \ 40 %{!p:crt0%O%s}}} \
41 %:if-exists(crti%O%s) \ 41 %:if-exists(crti%O%s) \
42 %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \ 42 %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
43 %{!static: \ 43 %{!static: \
44 %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}" 44 %{!shared: \
45 %{!pie:crtbegin%O%s} \
46 %{pie:crtbeginS%O%s}} \
47 %{shared:crtbeginS%O%s}}"
45 48
46 #undef STARTFILE_SPEC 49 #undef STARTFILE_SPEC
47 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC 50 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
48 51
49 52
50 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF. Here we 53 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF. Here we
51 add crtend.o, which provides part of the support for getting 54 add crtend.o, which provides part of the support for getting
52 C++ file-scope static objects deconstructed after exiting "main". */ 55 C++ file-scope static objects deconstructed after exiting "main". */
53 56
54 #define NETBSD_ENDFILE_SPEC \ 57 #define NETBSD_ENDFILE_SPEC \
55 "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \ 58 "%{!shared: \
59 %{!pie:crtend%O%s} \
60 %{pie:crtendS%O%s}} \
61 %{shared:crtendS%O%s} \
56 %:if-exists(crtn%O%s)" 62 %:if-exists(crtn%O%s)"
57 63
58 #undef ENDFILE_SPEC 64 #undef ENDFILE_SPEC
59 #define ENDFILE_SPEC NETBSD_ENDFILE_SPEC 65 #define ENDFILE_SPEC NETBSD_ENDFILE_SPEC
60 66
64 70
65 Target-specific code can use this in conjunction with any other 71 Target-specific code can use this in conjunction with any other
66 target-specific LINK_SPEC options. 72 target-specific LINK_SPEC options.
67 73
68 Target-specific code must provide the %(netbsd_entry_point) spec. */ 74 Target-specific code must provide the %(netbsd_entry_point) spec. */
75
76 #define NETBSD_LINK_LD_ELF_SO_SPEC \
77 "%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}"
69 78
70 #define NETBSD_LINK_SPEC_ELF \ 79 #define NETBSD_LINK_SPEC_ELF \
71 "%{assert*} %{R*} %{rpath*} \ 80 "%{assert*} %{R*} %{rpath*} \
72 %{shared:-shared} \ 81 %{shared:-shared} \
73 %{symbolic:-Bsymbolic} \ 82 %{symbolic:-Bsymbolic} \
79 %{!static: \ 88 %{!static: \
80 %{rdynamic:-export-dynamic} \ 89 %{rdynamic:-export-dynamic} \
81 -dynamic-linker /usr/libexec/ld.elf_so} \ 90 -dynamic-linker /usr/libexec/ld.elf_so} \
82 %{static:-static}}" 91 %{static:-static}}"
83 92
93 /* Provide the standard list of subtarget extra specs for NetBSD targets. */
94 #define NETBSD_SUBTARGET_EXTRA_SPECS \
95 { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, \
96 { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \
97 { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \
98 { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \
99 { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC },
100
101 #undef SUBTARGET_EXTRA_SPECS
102 #define SUBTARGET_EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
103
84 /* Use --as-needed -lgcc_s for eh support. */ 104 /* Use --as-needed -lgcc_s for eh support. */
85 #ifdef HAVE_LD_AS_NEEDED 105 #ifdef HAVE_LD_AS_NEEDED
86 #define USE_LD_AS_NEEDED 1 106 #define USE_LD_AS_NEEDED 1
87 #endif 107 #endif