lkml.org 
[lkml]   [2007]   [May]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 21 May 2007 21:52:59 -0700 (PDT)
FromLinus Torvalds <>
SubjectRe: [RFC] Crash on modpost, addend_386_rel()

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-22 07:05    [from the cache]
©2003-2008