File ipxe.R_X86_64_PLT32.patch of Package qemu-2.10

From: Michael Matz <matz@suse.com>
Date: Wed, 25 Jul 2018 13:24:50 +0000
Subject: R_X86_64_PLT32

Newer binutils (>= 2.31) will emit PLT32 relocs for call/jmp
instructions on x86_64 in some cases, instead of PC32 relocs
as before.  This can only be done because on x86-64 the PLT
doesn't need any special setup, and in turn this means that
for post-processing/after-link purposes PLT32 and PC32 relocs
can be handled the same.  elf2efi simply ignores all PC-relative
relocs (as the code is already fully final for them) and PLT32
is one of them, so add it to the list.

(Otherwise an "Unrecognized relocation type 4" error occurs
when building some of the EFI images for IPXE).
---
 src/util/elf2efi.c | 1 +
 1 file changed, 1 insertion(+)

--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -622,24 +622,25 @@ static void process_reloc ( struct elf_file *elf, const Elf_Shdr *shdr,
 			generate_pe_reloc ( pe_reltab, offset, 4 );
 			break;
 		case ELF_MREL ( EM_X86_64, R_X86_64_64 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_ABS64 ) :
 			/* Generate an 8-byte PE relocation */
 			generate_pe_reloc ( pe_reltab, offset, 8 );
 			break;
 		case ELF_MREL ( EM_386, R_386_PC32 ) :
 		case ELF_MREL ( EM_ARM, R_ARM_CALL ) :
 		case ELF_MREL ( EM_ARM, R_ARM_THM_PC22 ) :
 		case ELF_MREL ( EM_ARM, R_ARM_THM_JUMP24 ) :
 		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 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_ADR_PREL_PG_HI21 ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_ADD_ABS_LO12_NC ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_LDST8_ABS_LO12_NC ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_LDST16_ABS_LO12_NC ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_LDST32_ABS_LO12_NC ) :
 		case ELF_MREL ( EM_AARCH64, R_AARCH64_LDST64_ABS_LO12_NC ) :
 			/* Skip PC-relative relocations; all relative
 			 * offsets remain unaltered when the object is
 			 * loaded.
openSUSE Build Service is sponsored by