summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-12-02 16:34:20 +0000
committerkib <kib@FreeBSD.org>2009-12-02 16:34:20 +0000
commit0d2524b06305d5ae66fdcefc0a0d0321167718d9 (patch)
treef29596ca72fd7a0e77c68583e1ad685e3fb2d947 /contrib
parent2f0aea3d4ef3af824fdfcd7443c1d5a1bd3a1cbb (diff)
downloadFreeBSD-src-0d2524b06305d5ae66fdcefc0a0d0321167718d9.zip
FreeBSD-src-0d2524b06305d5ae66fdcefc0a0d0321167718d9.tar.gz
Properly support -fPIE by linking PIE binaries with specially-built
Scrt1.o instead of crt1.o, since the later is built as non-PIC. Separate i386-elf crt1.c into the pure assembler part and C code, supplying all data extracted by assembler stub as explicit parameters [1]. Hide and localize _start1 symbol used as an interface between asm and C code. In collaboration with: kan Inspired by: PR i386/127387 [1] Prodded and tested by: rdivacky [1] MFC after: 3 weeks
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gcc/config/freebsd-spec.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/gcc/config/freebsd-spec.h b/contrib/gcc/config/freebsd-spec.h
index 06735c8..5cd57b0 100644
--- a/contrib/gcc/config/freebsd-spec.h
+++ b/contrib/gcc/config/freebsd-spec.h
@@ -103,9 +103,10 @@ Boston, MA 02110-1301, USA. */
%{p:gcrt1.o%s} \
%{!p: \
%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
+ %{!profile: \
+ %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
crti.o%s \
- %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
+ %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on
our own magical crtend.o file (see crtstuff.c) which provides part of
@@ -113,8 +114,7 @@ Boston, MA 02110-1301, USA. */
entering `main', followed by the normal "finalizer" file, `crtn.o'. */
#define FBSD_ENDFILE_SPEC "\
- %{!shared:crtend.o%s} \
- %{shared:crtendS.o%s} \
+ %{shared|pie:crtendS.o%s;:crtend.o%s} \
crtn.o%s "
/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
OpenPOWER on IntegriCloud