Re: [PATCH 02/15] objtool: Add CONFIG_CFI_CLANG support

2021-04-20 Thread Sami Tolvanen
On Tue, Apr 20, 2021 at 12:48 PM Josh Poimboeuf wrote: > > On Fri, Apr 16, 2021 at 01:38:31PM -0700, Sami Tolvanen wrote: > > +static int fix_cfi_relocs(const struct elf *elf) > > +{ > > + struct section *sec, *tmpsec; > > + struct reloc *reloc, *tmpreloc; > > + > > + list_for_each_ent

Re: [PATCH 02/15] objtool: Add CONFIG_CFI_CLANG support

2021-04-20 Thread Josh Poimboeuf
On Fri, Apr 16, 2021 at 01:38:31PM -0700, Sami Tolvanen wrote: > +static int fix_cfi_relocs(const struct elf *elf) > +{ > + struct section *sec, *tmpsec; > + struct reloc *reloc, *tmpreloc; > + > + list_for_each_entry_safe(sec, tmpsec, &elf->sections, list) { > + list_for_ea

[PATCH 02/15] objtool: Add CONFIG_CFI_CLANG support

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function references with references to the CFI jump table, which confuses objtool. This change, based on Josh's initial patch [1], goes through the list of relocations and replaces jump table symbols with the actual function symbols. [1] https://lore.k