Some versions of gcc (observed with the cross-compiling gcc 9.3.0 in
Ubuntu 20.04) default to enabling -fPIE. Experimentation shows that
this results in the emission of R_AARCH64_ADR_GOT_PAGE relocation
records for __stack_chk_guard. These relocation types are not
supported by elf2efi.c.
Fix by explicitly disabling position-independent code for ARM64 EFI
builds.
Debugged-by: Antony Messerli <antony@mes.ser.li>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
# -*- makefile -*- : Force emacs to use Makefile mode
+# Avoid untranslatable relocations
+#
+CFLAGS += -fno-pic
+
# Specify EFI image builder
#
ELF2EFI = $(ELF2EFI64)