mirror of
https://github.com/dynup/kpatch
synced 2024-12-26 15:22:03 +00:00
commit
d026f9d866
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user