Re: Testing of function/data-sections on linux-2.6.35-rc4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 26, 2010 at 02:52:57AM +0200, Denys Vlasenko wrote:
> On Friday 23 July 2010 21:10, Sam Ravnborg wrote:
> > > 
> > > * modpost fix for 64k+ sections: linux-2.6.35-rc4-fs.modpost.patch
> > >   This patch is in -mm, it still not reach mainline...
> > > 
> > 
> > Some comments below - but noting fundamental.
> >
> > +	/* Fixup for more than 64k sections */
> > +	info->num_sections = hdr->e_shnum;
> > +	if (info->num_sections == 0) { /* more than 64k sections? */
> > +		/* note: it doesn't need shndx2secindex() */
> > +		info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
> > +	}
> > I had to read the above twice to get it.
> > How about something like this:
> > 
> > 	/* Fixup for more than 64k sections */
> > 	if (hdr->e_shnum == 0) {
> > 		/*
> > 		 * There are more than 64k sections,
> > 		 * read count from .sh_size.
> > 		 * note: it doesn't need shndx2secindex()
> > 		 */
> > 		info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
> > 	}
> > 	else {
> > 		info->num_sections = hdr->e_shnum;
> > 	}
> > 
> > 
> > +	info->secindex_strings = hdr->e_shstrndx;
> > +	if (info->secindex_strings == SHN_XINDEX)
> > +		info->secindex_strings =
> > +		    shndx2secindex(TO_NATIVE(sechdrs[0].sh_link));
> > 
> > Likewise here...
> 
> Done both.
> 
> ...
> > -	for (i = 1; i < hdr->e_shnum; i++) {
> > -		const char *secstrings
> > -			= (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
> > +	secstrings = (void *)hdr + sechdrs[info->secindex_strings].sh_offset;
> > 
> > Moving this assignnet out of the loop is an unrelated
> > but welcome change.
> 
> I take you are ok with it?
> 
> Please find updated patch below.
> 
> Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>

If the patch get a proper changelog then it has my:

Acked-by: Sam Ravnborg <sam@xxxxxxxxxxxx>

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux