Re: [RFC PATCH 04/10] objtool: add undwarf debuginfo generation

2017-06-22 Thread Josh Poimboeuf
On Thu, Jun 22, 2017 at 09:47:46AM +0200, Jiri Slaby wrote: > On 06/14/2017, 03:27 PM, Josh Poimboeuf wrote: > > I agree with all your comments, will fix them all. Thanks for the > > review. > > This is not the correct way: > ++ if (flags & O_WRONLY) > ++ cmd = ELF_C_WRITE; > ++

Re: [RFC PATCH 04/10] objtool: add undwarf debuginfo generation

2017-06-22 Thread Jiri Slaby
On 06/14/2017, 03:27 PM, Josh Poimboeuf wrote: > I agree with all your comments, will fix them all. Thanks for the > review. This is not the correct way: ++ if (flags & O_WRONLY) ++ cmd = ELF_C_WRITE; ++ else if (flags & O_RDWR) ++ cmd = ELF_C_RDWR; ++ els

Re: [RFC PATCH 04/10] objtool: add undwarf debuginfo generation

2017-06-14 Thread Josh Poimboeuf
On Wed, Jun 14, 2017 at 10:42:19AM +0200, Jiri Slaby wrote: > On 06/01/2017, 07:44 AM, Josh Poimboeuf wrote: > ... > > index 3fb0747..1ca5d9a 100644 > > --- a/tools/objtool/elf.c > > +++ b/tools/objtool/elf.c > ... > > +int elf_write_to_file(struct elf *elf, char *outfile) > > +{ > > + int fd; >

Re: [RFC PATCH 04/10] objtool: add undwarf debuginfo generation

2017-06-14 Thread Jiri Slaby
On 06/01/2017, 07:44 AM, Josh Poimboeuf wrote: ... > index 3fb0747..1ca5d9a 100644 > --- a/tools/objtool/elf.c > +++ b/tools/objtool/elf.c ... > +int elf_write_to_file(struct elf *elf, char *outfile) > +{ > + int fd; > + struct section *sec; > + Elf *elfout; > + GElf_Ehdr eh, ehout;

[RFC PATCH 04/10] objtool: add undwarf debuginfo generation

2017-05-31 Thread Josh Poimboeuf
Now that objtool knows the states of all registers on the stack for each instruction, it's straightforward to generate debuginfo for an unwinder to use. Instead of generating DWARF, generate a new format called undwarf, which is more suitable for an in-kernel unwinder. See tools/objtool/Documenta