summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2019-02-15 14:41:20 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-03-05 19:36:52 +0000
commit44b4ec740db6dafed432a411506bfd7975a221f8 (patch)
tree8619c36c53f8741cc6360fedb9eb7117199a26a2 /util/cbfstool
parent65200f0746d09ea3e53da248c7dabc4f19c80715 (diff)
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>
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/rmodule.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/cbfstool/rmodule.c b/util/cbfstool/rmodule.c
index 817bc604f0..80e89118e5 100644
--- a/util/cbfstool/rmodule.c
+++ b/util/cbfstool/rmodule.c
@@ -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)