lkml.org 
[lkml]   [2021]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 03/24] objtool: Handle __sanitize_cov*() tail calls
On Fri, Jun 25, 2021 at 09:38:24AM -0400, Steven Rostedt wrote:
> On Thu, 24 Jun 2021 11:41:02 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > +static void add_call_dest(struct objtool_file *file, struct instruction *insn,
> > + struct symbol *dest, bool sibling)
> > +{
> > + struct reloc *reloc = insn_reloc(file, insn);
> > +
> > + insn->call_dest = dest;
> > + if (!dest)
> > + return;
> > +
> > + if (insn->call_dest->static_call_tramp) {
> > + list_add_tail(&insn->call_node,
> > + &file->static_call_list);
> > + }
> > +
> > + if (insn->sec->noinstr &&
> > + !strncmp(insn->call_dest->name, "__sanitizer_cov_", 16)) {
> > + if (reloc) {
> > + reloc->type = R_NONE;
> > + elf_write_reloc(file->elf, reloc);
> > + }
> > +
> > + elf_write_insn(file->elf, insn->sec,
> > + insn->offset, insn->len,
> > + sibling ? arch_ret_insn(insn->len)
> > + : arch_nop_insn(insn->len));
> > +
> > + insn->type = sibling ? INSN_RETURN : INSN_NOP;
> > + }
> > +
> > + if (mcount && !strcmp(insn->call_dest->name, "__fentry__")) {
> > + if (sibling)
> > + WARN_FUNC("Tail call to __fentry__ !?!?", insn->sec, insn->offset);
>
> Have you ever triggered the above?

No, that would be really daft. But since this function is to be called
for both regular and tail calls, I figured I'd at least pretend to
handle the case.

\
 
 \ /
  Last update: 2021-06-26 10:20    [W:0.200 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site