summaryrefslogtreecommitdiffstats
path: root/lib/csu/arm
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 /lib/csu/arm
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 'lib/csu/arm')
-rw-r--r--lib/csu/arm/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile
index 23954e8..097f82d 100644
--- a/lib/csu/arm/Makefile
+++ b/lib/csu/arm/Makefile
@@ -4,7 +4,7 @@
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-OBJS+= gcrt1.o
+OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -Wall -Wno-unused \
-I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
@@ -16,6 +16,9 @@ CLEANFILES= ${OBJS}
gcrt1.o: crt1.c
${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC}
+Scrt1.o: crt1.c
+ ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC}
+
realinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${OBJS} ${DESTDIR}${LIBDIR}
OpenPOWER on IntegriCloud