From: Linus Torvalds <torvalds@linux-foundation.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: ben.collins@ubuntu.com, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, sam@ravnborg.org, dwmw2@infradead.org,
adobriyan@gmail.com
Subject: Re: [RFC] Crash on modpost, addend_386_rel()
Date: Mon, 21 May 2007 21:52:59 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.98.0705212150000.3890@woody.linux-foundation.org> (raw)
In-Reply-To: <20070522.134015.65004318.nemoto@toshiba-tops.co.jp>
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
next prev parent reply other threads:[~2007-05-22 4:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-22 2:01 Ben Collins
2007-05-22 4:40 ` Atsushi Nemoto
2007-05-22 4:52 ` Linus Torvalds [this message]
2007-05-22 5:29 ` Atsushi Nemoto
2007-05-22 9:27 ` Atsushi Nemoto
2007-05-22 14:48 ` Mika Penttilä
2007-05-23 14:51 ` Atsushi Nemoto
2007-05-23 15:23 ` Mika Penttilä
2007-05-23 16:00 ` Atsushi Nemoto
2007-05-22 4:43 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.0.98.0705212150000.3890@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=ben.collins@ubuntu.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®