x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible
authorJan Beulich <jbeulich@suse.com>
Thu, 22 Apr 2021 11:29:49 +0000 (13:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Apr 2021 11:29:49 +0000 (13:29 +0200)
commit1be65ec4c8bc172aadd6bc1b6553c668152899ae
tree26fb516ab6a17ef0335dbb8d1d2faa76aa2974ee
parentf27d9db17fdae34cb89441d0d5ebefb09fa7dce5
x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible

As of commit 6fa7408d72b3 ("ld: don't generate base relocations in PE
output for absolute symbols") I'm feeling sufficiently confident in GNU
ld to use its logic for generating base relocations, which was enabled
for executables at some point last year (prior to that this would have
got done only for DLLs).

GNU ld, seeing the original relocations coming from the ELF object files,
generates different relocation types for our page tables (64-bit ones,
while mkreloc produces 32-bit ones). This requires also permitting and
handling that type in efi_arch_relocate_image().

Note that in the case that we leave base relocation generation to ld,
while efi/relocs-dummy.o then won't be linked into any executable
anymore, it still needs generating (and hence dependencies need to be
kept as they are) in order to have VIRT_BASE pulled out of it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/Makefile
xen/arch/x86/efi/check.c
xen/arch/x86/efi/efi-boot.h