diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-09-08 18:58:53 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-09-08 18:58:53 +0000 |
commit | 547f7a8c5026dd25ea43b7df23bc46e0186adef8 (patch) | |
tree | cb0b1b9a7db2b5dc09a4e047d0b50e1758b39352 /gnu | |
parent | 1818ac423ced0860758b318916349ca3b46a7e0a (diff) |
Use rcrt0.o instead of crt0.o for -static -pie executables.
ok guenther@, jsg@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/gcc/gcc/config/arm/openbsd.h | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/gnu/gcc/gcc/config/arm/openbsd.h b/gnu/gcc/gcc/config/arm/openbsd.h index 91475ffb8d1..9431be1deb7 100644 --- a/gnu/gcc/gcc/config/arm/openbsd.h +++ b/gnu/gcc/gcc/config/arm/openbsd.h @@ -203,34 +203,12 @@ do \ } \ while (0) -/* Provide a STARTFILE_SPEC appropriate for OpenBSD ELF. Here we - provide support for the special GCC option -static. On ELF - targets, we also add the crtbegin.o file, which provides part - of the support for getting C++ file-scope static objects - constructed before entering "main". */ - -#define OPENBSD_STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt0%O%s} \ - %{!pg: \ - %{p:gcrt0%O%s} \ - %{!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}}" - +/* As an elf system, we need crtbegin/crtend stuff. */ #undef STARTFILE_SPEC -#define STARTFILE_SPEC OPENBSD_STARTFILE_SPEC - -/* Provide an ENDFILE_SPEC appropriate for OpenBSD ELF. Here we -add crtend.o, which provides part of the support for getting -C++ file-scope static objects deconstructed after exiting "main". */ - -#define OPENBSD_ENDFILE_SPEC \ - "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \ - %:if-exists(crtn%O%s)" - +#define STARTFILE_SPEC "\ + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \ + %{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \ + %{!nopie:rcrt0%O%s}}}} \ + crtbegin%O%s} %{shared:crtbeginS%O%s}" #undef ENDFILE_SPEC -#define ENDFILE_SPEC OPENBSD_ENDFILE_SPEC - +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" |