On Thu, Sep 22, 2016 at 03:21:00AM -0600, Jan Beulich wrote: > >>> On 21.09.16 at 18:57, <konrad.w...@oracle.com> wrote: > > @@ -325,8 +327,13 @@ static int move_payload(struct payload *payload, > > struct livepatch_elf *elf) > > * and .shstrtab. For the non-relocate we allocate and copy these > > * via other means - and the .rel we can ignore as we only use it > > * once during loading. > > + * > > + * Also ignore sections with zero size. Those can be .data, or > > .bss. > > Or any others. Please make this apparent by adding "e.g." or some > such.
<nods> > > > + * > > + * This logic must MATCH what is done in > > livepatch_elf_resolve_symbols. > > Instead of such a comment, is it perhaps worth making an inline > function or macro to cover the three instances where these > checks need to match up? Yes. That would be much simpler. > > > @@ -374,14 +381,18 @@ static int move_payload(struct payload *payload, > > struct livepatch_elf *elf) > > > > for ( i = 1; i < elf->hdr->e_shnum; i++ ) > > { > > - if ( elf->sec[i].sec->sh_flags & SHF_ALLOC ) > > + if ( elf->sec[i].sec->sh_flags & SHF_ALLOC && > > elf->sec[i].sec->sh_size ) > > Please parenthesize the & in cases like this. > > Jan > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel