aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-10-12 11:27:08 +0000
committerKyle Evans <kevans@FreeBSD.org>2021-10-08 08:12:10 +0000
commitaa2cddc0d21d7411121740efdf4d69c1c743ce4b (patch)
tree4fdb018847a36a943ff0244e7ffd4204d759b101
parent5f9186c384db6886a1079fd0477ce008125ba9e4 (diff)
downloadsrc-aa2cddc0d21d7411121740efdf4d69c1c743ce4b.tar.gz
src-aa2cddc0d21d7411121740efdf4d69c1c743ce4b.zip
Link efi programs with -pie rather than -shared
This was causing build failures in CheriBSD where we were passing -pie already by default. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D24787 (cherry picked from commit 253e820a4db794c4c5e39e8e6d6bf2775f25d0cc)
-rw-r--r--stand/efi/boot1/Makefile2
-rw-r--r--stand/efi/loader/Makefile2
2 files changed, 2 insertions, 2 deletions
diff --git a/stand/efi/boot1/Makefile b/stand/efi/boot1/Makefile
index d4ac55598bb7..bf3860f36b5d 100644
--- a/stand/efi/boot1/Makefile
+++ b/stand/efi/boot1/Makefile
@@ -65,7 +65,7 @@ FILES= ${BOOT1}.efi ${BOOT1}.efifat
FILESMODE_${BOOT1}.efi= ${BINMODE}
LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE}
-LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
+LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
.if ${MACHINE_CPUARCH} == "aarch64"
CFLAGS+= -mgeneral-regs-only
diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index 6ee613e7bfea..993a869ab13e 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -84,7 +84,7 @@ LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi
.endif
LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE}
-LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
+LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
CLEANFILES+= loader.efi