From: Ralf Baechle <ralf@linux-mips.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: GCC Help Mailing List <gcc-help@gcc.gnu.org>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>
Subject: Re: Relocation problem with MIPS kernel modules
Date: Mon, 3 Aug 2009 10:20:30 +0100 [thread overview]
Message-ID: <20090803092030.GB30431@linux-mips.org> (raw)
In-Reply-To: <20090730184923.GA27030@cuplxvomd02.corp.sa.net>
On Thu, Jul 30, 2009 at 11:49:23AM -0700, David VomLehn wrote:
> To: GCC Help Mailing List <gcc-help@gcc.gnu.org>,
> Linux MIPS Mailing List <linux-mips@linux-mips.org>
> Subject: Relocation problem with MIPS kernel modules
> Content-Type: text/plain; charset=us-ascii
>
> I have a MIPS loadable kernel module that, when I try to insmod it, causes the
> kernel to emit the message:
>
> module xyz: dangerous relocation
>
> This message appears in three different places in arch/mips/kernel/module.c,
> but this one is coming from apply_r_mips_lo16_rel(). The module code at
I'll change the messages to indicate the relocation type.
> the location at which the error message is generated appears to be pretty
> bland:
> lw v0,28564(s1)
> with the expected relocation type of R_MIPS_LO16. The relocation before it
> is R_MIPS_HI16, as expected, but for a different symbol. Before *that*
> is another R_MIPS_HI16 relocation entry for yet a third symbol.
>
> According to the MIPS ABI, for what it's worth, "Each relocation type of
> R_MIPS_HI16 must have an associated R_MIPS_LO16 entry immediately following
> it in the list of relocations." So, what's actually getting generated by
> gcc and linker differs from the closest thing we have to an ABI of record for
> MIPS processors.
The GNU tools as an extension over the MIPS ABI allows an arbitrary number of
R_MIPS_HI16 relocations to be followed by a R_MIPS_LO16 symbol. All
relocations of this sequence must use the same symbol, of course. This is
a very old extension; I think it predates the Linux/MIPS port.
Ralf
next prev parent reply other threads:[~2009-08-03 9:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-30 18:49 Relocation problem with MIPS kernel modules David VomLehn
2009-07-30 19:15 ` David Daney
2009-07-30 21:26 ` David VomLehn
2009-08-03 9:20 ` Ralf Baechle [this message]
2009-08-03 18:19 ` David VomLehn
2009-08-03 18:44 ` David Daney
2009-08-03 19:14 ` Ralf Baechle
2009-08-07 6:38 ` Marshall B. Rogers
2009-08-03 19:33 ` David Daney
2009-08-03 20:15 ` David VomLehn
2009-08-03 23:55 ` Ralf Baechle
2009-08-04 2:18 ` David VomLehn
2009-08-07 15:29 ` Maciej W. Rozycki
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=20090803092030.GB30431@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=dvomlehn@cisco.com \
--cc=gcc-help@gcc.gnu.org \
--cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.