Re: [RFC PATCH v2 4/6] livepatch: reuse module loader code to write relocations

2015-12-10 Thread Josh Poimboeuf
On Thu, Dec 10, 2015 at 08:56:27PM +0100, Jiri Kosina wrote: > On Thu, 10 Dec 2015, Minfei Huang wrote: > > > > + klp_for_each_reloc_sec(obj, reloc_sec) { > > > + relindex = reloc_sec->index; > > > + num_relas = pmod->sechdrs[relindex].sh_size / sizeof(Elf_Rela); > > > + re

Re: [RFC PATCH v2 4/6] livepatch: reuse module loader code to write relocations

2015-12-10 Thread Jiri Kosina
On Thu, 10 Dec 2015, Minfei Huang wrote: > > + klp_for_each_reloc_sec(obj, reloc_sec) { > > + relindex = reloc_sec->index; > > + num_relas = pmod->sechdrs[relindex].sh_size / sizeof(Elf_Rela); > > + rela = (Elf_Rela *) pmod->sechdrs[relindex].sh_addr; > > + > > +

Re: [RFC PATCH v2 4/6] livepatch: reuse module loader code to write relocations

2015-12-10 Thread Minfei Huang
On 11/30/15 at 11:21P, Jessica Yu wrote: > + klp_for_each_reloc_sec(obj, reloc_sec) { > + relindex = reloc_sec->index; > + num_relas = pmod->sechdrs[relindex].sh_size / sizeof(Elf_Rela); > + rela = (Elf_Rela *) pmod->sechdrs[relindex].sh_addr; > + > +

Re: [RFC PATCH v2 4/6] livepatch: reuse module loader code to write relocations

2015-12-08 Thread Josh Poimboeuf
On Mon, Nov 30, 2015 at 11:21:17PM -0500, Jessica Yu wrote: > Reuse module loader code to write relocations, thereby eliminating the need > for architecture specific relocation code in livepatch. Namely, we reuse > apply_relocate_add() in the module loader to write relocations instead of > duplicat

[RFC PATCH v2 4/6] livepatch: reuse module loader code to write relocations

2015-11-30 Thread Jessica Yu
Reuse module loader code to write relocations, thereby eliminating the need for architecture specific relocation code in livepatch. Namely, we reuse apply_relocate_add() in the module loader to write relocations instead of duplicating functionality in livepatch's klp_write_module_reloc(). To apply