Re: [RFC] Crash on modpost, addend_386_rel()

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

 




On Tue, 22 May 2007, Atsushi Nemoto wrote:
> 
> Anyway, here is a updated patch tested on i386 (RELOCATABLE=y/n), arm,
> and mips.  On calculation of 'location', sh_addr should be subtracted
> (thank you for debugging, Linus).  And this patch contains an another
> fix and an improvement of added_mips_rel

Would you mind also just making this whole logic (that is generic and 
shared with all the different arch versions) be an inline function of its 
own? 

> +	Elf_Shdr *sechdrs = elf->sechdrs;
> +	unsigned int *location;
> +	int section = sechdrs[rsection].sh_info;
> +
> +	location = (void *)elf->hdr + sechdrs[section].sh_offset +
> +		(r->r_offset - sechdrs[section].sh_addr);

so that all the functions could just use some generic

	location = reloc_location(elf, rsection, r);

or similar, instead of having that complex thing duplicated three times 
(arm, mips and i386)?

Especially since other architectures will likely end up doing the same 
thing too...

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux