Re: [PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-19 Thread Josh Poimboeuf
On Fri, Mar 19, 2021 at 04:24:40PM +0100, Peter Zijlstra wrote: > On Fri, Mar 19, 2021 at 10:12:59AM -0500, Josh Poimboeuf wrote: > > > > -void elf_add_reloc(struct elf *elf, struct reloc *reloc) > > > +int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long > > > offset, > > > +

Re: [PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-19 Thread Peter Zijlstra
On Fri, Mar 19, 2021 at 10:12:59AM -0500, Josh Poimboeuf wrote: > > -void elf_add_reloc(struct elf *elf, struct reloc *reloc) > > +int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long > > offset, > > + unsigned int type, struct symbol *sym, int addend) > > { > > -

Re: [PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-19 Thread Josh Poimboeuf
On Fri, Mar 19, 2021 at 10:47:36AM +0100, Peter Zijlstra wrote: > Full patch, because diff on a diff on a diff is getting ludicrous hard > to read :-) Appreciated :-) > -void elf_add_reloc(struct elf *elf, struct reloc *reloc) > +int elf_add_reloc(struct elf *elf, struct section *sec, unsigned lo

Re: [PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-19 Thread Peter Zijlstra
On Thu, Mar 18, 2021 at 08:42:46PM -0500, Josh Poimboeuf wrote: > On Thu, Mar 18, 2021 at 06:11:11PM +0100, Peter Zijlstra wrote: > > We have 4 instances of adding a relocation. Create a common helper > > to avoid growing even more. > > > > Signed-off-by: Peter Zijlstra (Intel) > > I'm not a fan

Re: [PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-18 Thread Josh Poimboeuf
On Thu, Mar 18, 2021 at 06:11:11PM +0100, Peter Zijlstra wrote: > We have 4 instances of adding a relocation. Create a common helper > to avoid growing even more. > > Signed-off-by: Peter Zijlstra (Intel) I'm not a fan of the API -- how about squashing this in? Untested, of course. diff --git

[PATCH v2 08/14] objtool: Add elf_create_reloc() helper

2021-03-18 Thread Peter Zijlstra
We have 4 instances of adding a relocation. Create a common helper to avoid growing even more. Signed-off-by: Peter Zijlstra (Intel) --- tools/objtool/check.c | 76 ++-- tools/objtool/elf.c | 90 +++--- too