From 96b4e099d879f38dcad8741841f42484b234b3f0 Mon Sep 17 00:00:00 2001 From: Corey Henderson Date: Mon, 8 Sep 2014 22:04:18 -0400 Subject: [PATCH 1/3] Be more specific about the bad first instruction --- kpatch-build/create-diff-object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index dbfee0b..5297b68 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -2340,7 +2340,7 @@ void kpatch_create_mcount_sections(struct kpatch_elf *kelf) sym->sec->data->d_buf = newdata; insn = newdata; if (insn[0] != 0xf) - ERROR("bad first instruction in %s", sym->name); + ERROR("function '%s' has no fentry call; unable to patch", sym->name); insn[0] = 0xe8; insn[1] = 0; insn[2] = 0; @@ -2351,7 +2351,7 @@ void kpatch_create_mcount_sections(struct kpatch_elf *kelf) list); if (rela->type != R_X86_64_NONE || strcmp(rela->sym->name, "__fentry__")) - ERROR("bad first rela in %s", sym->sec->rela->name); + ERROR("rela '%s' has no fentry section; unable to patch", sym->sec->rela->name); rela->type = R_X86_64_PC32; index++; From 3e14e1859fea398f10ef419bf9072d6ce508d376 Mon Sep 17 00:00:00 2001 From: Corey Henderson Date: Mon, 8 Sep 2014 22:21:20 -0400 Subject: [PATCH 2/3] change in wording per jpoimboe --- kpatch-build/create-diff-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 5297b68..4bd5f5b 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -2351,7 +2351,7 @@ void kpatch_create_mcount_sections(struct kpatch_elf *kelf) list); if (rela->type != R_X86_64_NONE || strcmp(rela->sym->name, "__fentry__")) - ERROR("rela '%s' has no fentry section; unable to patch", sym->sec->rela->name); + ERROR("function '%s' has no fentry call; unable to patch", sym->sec->rela->name); rela->type = R_X86_64_PC32; index++; From 3d9a140bfa6076a0cf60a90b3db6a59a30e1735e Mon Sep 17 00:00:00 2001 From: Corey Henderson Date: Mon, 8 Sep 2014 22:44:55 -0400 Subject: [PATCH 3/3] oops, use sym->name, not sym->sec->rela->name --- kpatch-build/create-diff-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 4bd5f5b..dbe6ddf 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -2351,7 +2351,7 @@ void kpatch_create_mcount_sections(struct kpatch_elf *kelf) list); if (rela->type != R_X86_64_NONE || strcmp(rela->sym->name, "__fentry__")) - ERROR("function '%s' has no fentry call; unable to patch", sym->sec->rela->name); + ERROR("function '%s' has no fentry call; unable to patch", sym->name); rela->type = R_X86_64_PC32; index++;