Re: objtool crashes with some clang produced .o files

From: Nick Desaulniers
Date: Fri Dec 11 2020 - 19:44:01 EST


On Fri, Dec 11, 2020 at 12:57 PM Nick Desaulniers
<ndesaulniers@xxxxxxxxxx> wrote:
>
> Thanks for the patch!
>
> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1207

Arnd reported another objtool warning/error from another randconfig in
https://github.com/ClangBuiltLinux/linux/issues/1209 and CrOS just hit
this as well.

I haven't been able to isolate the configs yet (Arnd has posted the
full config: https://pastebin.com/wwwhUL8L

$ ./tools/objtool/objtool orc generate --no-fp --no-unreachable
--retpoline arch/x86/entry/thunk_64.o
arch/x86/entry/thunk_64.o: warning: objtool: missing symbol for insn
at offset 0x3e

Is the offset 0x3e referring to the final `ret` instruction in
preempt_schedule_notrace_thunk? Observing insn_to_reloc_sym_addend()
(with your patch applied), it looks like both calls to
find_symbol_containing() with offset and offset-1 returns NULL. I'm
curious if there's another quirk going on here, or possibly a config
from the randconfig that's messing up the special case? I don't follow
the comment about:
119 * Hack alert. This happens when we need to reference
120 * the NOP pad insn immediately after the function.
121 */

Attached the object file FWIW.
--
Thanks,
~Nick Desaulniers

Attachment: thunk_64.o
Description: Binary data