From bdd2f0a7e446c51cbc62696b2a16131133dffca4 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Fri, 13 Nov 2015 08:33:44 +0000 Subject: [PATCH] For Xen, treat PLT32 relocations like PC32 PLT32 relocations are only used because gcc doesn't support symbol visibility for builtins like memcpy. --- common.c | 3 ++- create-diff-object.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.c b/common.c index 5efaec8..7b71476 100644 --- a/common.c +++ b/common.c @@ -344,7 +344,8 @@ static void xsplice_create_rela_list(struct xsplice_elf *kelf, * If the relocation is to a debug frame, ignore the * since it encodes the line number. */ - if (rela->type == R_X86_64_PC32) { + if (rela->type == R_X86_64_PC32 || + rela->type == R_X86_64_PLT32) { if (!strncmp(sec->base->name, ".text", 5)) { struct insn insn; rela_insn(sec, rela, &insn); diff --git a/create-diff-object.c b/create-diff-object.c index e560f0c..04aadef 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -147,7 +147,8 @@ static void xsplice_replace_sections_syms(struct xsplice_elf *kelf) continue; } - if (rela->type == R_X86_64_PC32) { + if (rela->type == R_X86_64_PC32 || + rela->type == R_X86_64_PLT32) { struct insn insn; rela_insn(sec, rela, &insn); add_off = (long)insn.next_byte - -- 2.39.5