Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31468 )
Change subject: rmodule: Add support for R_X86_64_PLT32 ......................................................................
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 --- M util/cbfstool/rmodule.c 1 file changed, 8 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/util/cbfstool/rmodule.c b/util/cbfstool/rmodule.c index 817bc60..80e8911 100644 --- a/util/cbfstool/rmodule.c +++ b/util/cbfstool/rmodule.c @@ -50,12 +50,18 @@
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)