aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/netbsd-elf.h
diff options
context:
space:
mode:
authorMaya Rashish <coypu@sdf.org>2018-11-09 20:55:39 +0000
committerJeff Law <law@gcc.gnu.org>2018-11-09 13:55:39 -0700
commita0f503a0f4335a7ff8958d2e15df03d62c1dcd92 (patch)
tree135f3e89953b1d302358aa08af880f2fd2cf84da /gcc/config/netbsd-elf.h
parente602e1f79ba78ff4be718664b9bbf4ed290bdbbe (diff)
downloadgcc-a0f503a0f4335a7ff8958d2e15df03d62c1dcd92.zip
gcc-a0f503a0f4335a7ff8958d2e15df03d62c1dcd92.tar.gz
gcc-a0f503a0f4335a7ff8958d2e15df03d62c1dcd92.tar.bz2
re PR target/87221 (cannot build with -pie)
PR target/87221 * config/netbsd-elf.h (NETBSD_STARTFILE_SPEC): Use crtbeginS.o for PIE. (NETBSD_ENDFILE_SPEC): Use crtendS.o for PIE. From-SVN: r265994
Diffstat (limited to 'gcc/config/netbsd-elf.h')
-rw-r--r--gcc/config/netbsd-elf.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/config/netbsd-elf.h b/gcc/config/netbsd-elf.h
index 4dc2aa7..26e5d99 100644
--- a/gcc/config/netbsd-elf.h
+++ b/gcc/config/netbsd-elf.h
@@ -40,8 +40,11 @@ along with GCC; see the file COPYING3. If not see
%{!p:crt0%O%s}}} \
%:if-exists(crti%O%s) \
%{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
- %{!static: \
- %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}"
+ %{!static: \
+ %{!shared: \
+ %{!pie:crtbegin%O%s} \
+ %{pie:crtbeginS%O%s}} \
+ %{shared:crtbeginS%O%s}}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
@@ -52,7 +55,10 @@ along with GCC; see the file COPYING3. If not see
C++ file-scope static objects deconstructed after exiting "main". */
#define NETBSD_ENDFILE_SPEC \
- "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
+ "%{!shared: \
+ %{!pie:crtend%O%s} \
+ %{pie:crtendS%O%s}} \
+ %{shared:crtendS%O%s} \
%:if-exists(crtn%O%s)"
#undef ENDFILE_SPEC