From 133f4c47baef6002b2ccb4904a035cda2303c6e5 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Sat, 25 Aug 2018 13:53:08 +0200
Subject: [PATCH] [build] Handle R_X86_64_PLT32 from binutils 2.31

Starting from binutils 2.31.0 (commit bd7ab16b) x86-64 assembler
generates R_X86_64_PLT32 instead of R_X86_64_PC32.

Acked-by: John Jolly <jjolly@suse.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
---
 src/util/elf2efi.c | 1 +
 1 file changed, 1 insertion(+)

Backport-Note: the old code had individual strcmp
instead of a switch/case

Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Original-Author: Michael Brown <mcb30@ipxe.org>
Origin: backport, https://git.ipxe.org/ipxe.git/commit/133f4c47baef6002b2ccb4904a035cda2303c6e5
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1793541
Last-Update: 2018-06-20

--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -491,7 +491,8 @@ static void process_reloc ( bfd *bfd __a
 		/* Generate a 2-byte PE relocation */
 		generate_pe_reloc ( pe_reltab, offset, 2 );
 	} else if ( ( strcmp ( howto->name, "R_386_PC32" ) == 0 ) ||
-		    ( strcmp ( howto->name, "R_X86_64_PC32" ) == 0 ) ) {
+				( strcmp ( howto->name, "R_X86_64_PC32" ) == 0 ) ||
+				( strcmp ( howto->name, "R_X86_64_PLT32" ) == 0 ) ) {
 		/* Skip PC-relative relocations; all relative offsets
 		 * remain unaltered when the object is loaded.
 		 */
