From 76157dce4ab70b1a404c2d9b7cb5970fe1c1a15e Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 4 Jun 2014 11:38:30 -0500 Subject: [PATCH] kmod/core: add support for R_X86_64_64 dynrelas Needed for relocations to data sections. --- kmod/core/core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kmod/core/core.c b/kmod/core/core.c index ddda7ee..50c4728 100644 --- a/kmod/core/core.c +++ b/kmod/core/core.c @@ -538,11 +538,15 @@ static int kpatch_write_relocations(struct kpatch_module *kpmod) val = (s32)src_addr + dynrela->addend; size = 4; break; + case R_X86_64_64: + loc = dynrela->dest; + val = dynrela->src; + size = 8; + break; default: - printk("unsupported rela type %ld for " - "0x%lx <- 0x%lx at index %d\n", - dynrela->type, dynrela->dest, - src_addr, i); + printk("unsupported rela type %ld for source %s (0x%lx <- 0x%lx) at index %d\n", + dynrela->type, dynrela->name, + dynrela->dest, src_addr, i); return -EINVAL; }