mirror of https://github.com/dynup/kpatch
Merge pull request #644 from jpoimboe/no-seg-fault
create-diff-object: print error message instead of seg faulting
This commit is contained in:
commit
5046cc9243
|
@ -2043,8 +2043,12 @@ void kpatch_create_dynamic_rela_sections(struct kpatch_elf *kelf,
|
|||
ALLOC_LINK(dynrela, &relasec->relas);
|
||||
if (sec->base->sym)
|
||||
dynrela->sym = sec->base->sym;
|
||||
else
|
||||
else if (sec->base->secsym)
|
||||
dynrela->sym = sec->base->secsym;
|
||||
else
|
||||
ERROR("can't create dynrela for section %s (symbol %s): no bundled section or section symbol",
|
||||
sec->name, rela->sym->name);
|
||||
|
||||
dynrela->type = R_X86_64_64;
|
||||
dynrela->addend = rela->offset;
|
||||
dynrela->offset = index * sizeof(*dynrelas);
|
||||
|
|
Loading…
Reference in New Issue