Skip to content

Commit

Permalink
Merge pull request #1326 from joe-lawrence/batch-sibling-calls
Browse files Browse the repository at this point in the history
create-diff-object: batch report unsupported sibling calls
  • Loading branch information
joe-lawrence authored Mar 6, 2023
2 parents a45c17f + 75421ca commit e862752
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kpatch-build/create-diff-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3860,6 +3860,7 @@ static void kpatch_no_sibling_calls_ppc64le(struct kpatch_elf *kelf)
struct symbol *sym;
unsigned char *insn;
unsigned int offset;
int sibling_call_errors = 0;

if (kelf->arch != PPC64)
return;
Expand Down Expand Up @@ -3893,10 +3894,15 @@ static void kpatch_no_sibling_calls_ppc64le(struct kpatch_elf *kelf)
if (!find_rela_by_offset(sym->sec->rela, offset))
continue;

ERROR("Found an unsupported sibling call at %s()+0x%lx. Add __attribute__((optimize(\"-fno-optimize-sibling-calls\"))) to %s() definition.",
log_normal("Found an unsupported sibling call at %s()+0x%lx. Add __attribute__((optimize(\"-fno-optimize-sibling-calls\"))) to %s() definition.\n",
sym->name, sym->sym.st_value + offset, sym->name);
sibling_call_errors++;
}
}

if (sibling_call_errors)
ERROR("Found %d unsupported sibling call(s) in the patched code.",
sibling_call_errors);
}

/* Check which functions have fentry/mcount calls; save this info for later use. */
Expand Down

0 comments on commit e862752

Please sign in to comment.