Re: [RFC][PATCH 2/3] objtool: Provide elf_write_{insn,reloc}()

2020-06-16 Thread Matt Helsley
On Tue, Jun 16, 2020 at 11:12:53AM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2020 at 04:30:36PM +0200, Peter Zijlstra wrote: > > +int elf_write_insn(struct elf *elf, struct section *sec, > > + unsigned long offset, unsigned int len, > > + const char *insn) > > +{ > >

Re: [RFC][PATCH 2/3] objtool: Provide elf_write_{insn,reloc}()

2020-06-16 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 04:30:36PM +0200, Peter Zijlstra wrote: > +int elf_write_insn(struct elf *elf, struct section *sec, > +unsigned long offset, unsigned int len, > +const char *insn) > +{ > + Elf_Data *data = sec->data; > + > + if (data->d_type != ELF_T_

[RFC][PATCH 2/3] objtool: Provide elf_write_{insn,reloc}()

2020-06-12 Thread Peter Zijlstra
This provides infrastructure to rewrite instructions; this is immediately useful for helping out with KCOV-vs-noinstr, but will also come in handy for a bunch of variable sized jump-label patches that are still on ice. Signed-off-by: Peter Zijlstra (Intel) --- tools/objtool/elf.c | 52