Skip to content

Commit

Permalink
Merge pull request #235 from jpoimboe/verbose-fix
Browse files Browse the repository at this point in the history
__verbose rela fix
  • Loading branch information
sjenning committed Jun 4, 2014
2 parents ba70380 + 0f908fb commit d026f9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
12 changes: 8 additions & 4 deletions kmod/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,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 = src_addr;
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;
}

Expand Down
12 changes: 5 additions & 7 deletions kpatch-build/create-diff-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,7 @@ void kpatch_include_symbol(struct symbol *sym, int recurselevel)
sec = sym->sec;
sec->include = 1;
inc_printf("section %s is included\n", sec->name);
if (sec->secsym == sym)
goto out;
if (sec->secsym) {
if (sec->secsym && sec->secsym != sym) {
sec->secsym->include = 1;
inc_printf("section symbol %s is included\n", sec->secsym->name);
}
Expand Down Expand Up @@ -1742,10 +1740,10 @@ void kpatch_create_dynamic_rela_sections(struct kpatch_elf *kelf,

/* add rela to fill in dest field */
ALLOC_LINK(dynrela, &relasec->relas);
if (!sec2->base->sym)
ERROR("expected bundled symbol for section %s for dynrela src %s",
sec2->base->name, rela->sym->name);
dynrela->sym = sec2->base->sym;
if (sec2->base->sym)
dynrela->sym = sec2->base->sym;
else
dynrela->sym = sec2->base->secsym;
dynrela->type = R_X86_64_64;
dynrela->addend = rela->offset;
dynrela->offset = index * sizeof(*dynrelas);
Expand Down

0 comments on commit d026f9d

Please sign in to comment.