lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] objtool: Support Clang non-section symbols in ORC generation
On Fri, Apr 03, 2020 at 10:58:20AM +0200, Miroslav Benes wrote:
> > + if (insn_sec->sym) {
> > + rela->sym = insn_sec->sym;
> > + rela->addend = insn_off;
> > + } else {
> > + /*
> > + * The Clang assembler doesn't produce section symbols, so we
> > + * have to reference the function symbol instead:
> > + */
> > + rela->sym = find_symbol_containing(insn_sec, insn_off);
> > + if (!rela->sym) {
> > + /*
> > + * Hack alert. This happens when we need to reference
> > + * the NOP pad insn immediately after the function.
> > + */
> > + rela->sym = find_symbol_containing(insn_sec,
> > + insn_off - 1);
> > + }
>
> I suppose there is always just one NOP pad insn, right? Anyway, it would
> be better to get rid of it as you proposed.

There can actually be multiple NOPs because functions are aligned on a
16-byte boundary. But the undefined ORC entry is always at the first
NOP because objtool merges duplicate entries.

--
Josh

\
 
 \ /
  Last update: 2020-04-03 16:59    [W:1.408 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site