rmodule: Add support for R_X86_64_PLT32

The recent toolchain update also updated binutils, which has a new
relocation type, introduced with commit bd7ab16b
(x86-64: Generate branch with PLT32 relocation).

Add support for R_X86_64_PLT32, which is handled as R_X86_64_PC32.
Add comment explaining the situation.
Fixes build error on x86_64.

Change-Id: I81350d2728c20ac72cc865e7ba92319858352632
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31468
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2019-02-15 14:41:20 +01:00 committed by Patrick Georgi
parent 65200f0746
commit 44b4ec740d
1 changed files with 8 additions and 2 deletions

View File

@ -50,12 +50,18 @@ static int valid_reloc_amd64(Elf64_Rela *rel)
type = ELF64_R_TYPE(rel->r_info);
/* Only these 5 relocations are expected to be found. */
/* Only these 6 relocations are expected to be found. */
return (type == R_AMD64_64 ||
type == R_AMD64_PC64 ||
type == R_AMD64_32S ||
type == R_AMD64_32 ||
type == R_AMD64_PC32);
type == R_AMD64_PC32 ||
/*
* binutils 2.31 introduced R_AMD64_PLT32 for non local
* functions. As we don't care about procedure linkage
* table entries handle it as R_X86_64_PC32.
*/
type == R_AMD64_PLT32);
}
static int should_emit_amd64(Elf64_Rela *rel)