stand/efi: Pass --no-dynamic-linker to ld.bfd >= 2.34.

ld.bfd in binutils 2.34+ now reports an error in more cases for custom
ldscripts that do not place PHDRs in a LOAD segment.  However, EFI
binaries are not dynamic binaries which need PHDRs, so pass
--no-dynamic-linker to disable this check.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34124
This commit is contained in:
John Baldwin 2022-02-02 12:18:43 -08:00
parent 6ad26abca5
commit 8bd5e2f15c
2 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,9 @@ FILESMODE_${BOOT1}.efi= ${BINMODE}
LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE}
LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
.if ${LINKER_TYPE} == "bfd" && ${LINKER_VERSION} >= 23400
LDFLAGS+= -Wl,--no-dynamic-linker
.endif
.if ${MACHINE_CPUARCH} == "aarch64"
CFLAGS+= -mgeneral-regs-only

View File

@ -99,6 +99,9 @@ LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi
LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE}
LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
.if ${LINKER_TYPE} == "bfd" && ${LINKER_VERSION} >= 23400
LDFLAGS+= -Wl,--no-dynamic-linker
.endif
CLEANFILES+= loader.efi