[ipxe-devel] Fix elf2efi to recognize R_X86_64_PLT32 relocation type

John Jolly jjolly at suse.com
Tue Aug 21 15:31:09 UTC 2018


Recent changes in GNU build tools causes a build failure with ipxe.efi 
during the elf2efi64 conversion:

  ./util/elf2efi64 --subsystem=10 bin-x86_64-efi/ipxe.efi.tmp bin-x86_64-efi/ipxe.efi
  Unrecognised relocation type 4
  make: *** [Makefile.efi:26: bin-x86_64-efi/ipxe.efi] Error 1

The relocation type 4 is defined in elf.h as R_X86_64_PLT32 and is now 
being used by the GNU linker. This is currently not supported by the 
elf2efi.c source found in ipxe.

This error is resolved by adding R_X86_64_PLT32 to the list of 
recognized relocation headers types for elf2efi.

Signed-off-by: John Jolly <jjolly at suse.com>
Also-fixed-by: Michael Matz <matz at suse.com>

---
Index: b/src/util/elf2efi.c
===================================================================
--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -635,6 +635,7 @@ static void process_reloc ( struct elf_f
 		case ELF_MREL ( EM_ARM, R_ARM_THM_JUMP24 ) :
 		case ELF_MREL ( EM_ARM, R_ARM_V4BX ):
 		case ELF_MREL ( EM_X86_64, R_X86_64_PC32 ) :
+		case ELF_MREL ( EM_X86_64, R_X86_64_PLT32 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_CALL26 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_JUMP26 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_ADR_PREL_LO21 ) :



More information about the ipxe-devel mailing list