diff options
author | kib <kib@FreeBSD.org> | 2009-12-02 16:34:20 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-12-02 16:34:20 +0000 |
commit | 0d2524b06305d5ae66fdcefc0a0d0321167718d9 (patch) | |
tree | f29596ca72fd7a0e77c68583e1ad685e3fb2d947 /lib/csu/ia64 | |
parent | 2f0aea3d4ef3af824fdfcd7443c1d5a1bd3a1cbb (diff) | |
download | FreeBSD-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/ia64')
-rw-r--r-- | lib/csu/ia64/Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/csu/ia64/Makefile b/lib/csu/ia64/Makefile index c906c09..d795103 100644 --- a/lib/csu/ia64/Makefile +++ b/lib/csu/ia64/Makefile @@ -4,7 +4,7 @@ SRCS= crt1.S 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.S ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.S + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} |