From: Ralf Baechle <ralf@linux-mips.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: David Daney <ddaney@caviumnetworks.com>,
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: Tue, 4 Aug 2009 00:55:36 +0100 [thread overview]
Message-ID: <20090803235536.GB22543@linux-mips.org> (raw)
In-Reply-To: <20090803201521.GA24691@cuplxvomd02.corp.sa.net>
On Mon, Aug 03, 2009 at 01:15:21PM -0700, David VomLehn wrote:
> > Actually I think it is the opposite:
> >
> > RELOCATION RECORDS FOR [.text]:
> > OFFSET TYPE VALUE
> > 00000000 R_MIPS_HI16 .bss+0x00000004
> > 00000008 R_MIPS_LO16 .bss+0x00000004
> > 00000014 R_MIPS_LO16 .bss+0x00000004
> >
> > We load the hi16 value into a register and then use multiple lo16
> > offsets for the follow loads and stores to the same location. On a
> > read-modify-write we only want to load the base address one time.
>
> This particular case is covered by the old MIPS Processor psABI:
>
> R_MIPS_LO16 entries without an R_MIPS_HI16 entry immediately preceding
> are orphaned and the previously defined R_MIPS_HI16 is used for
> computing the addend.
>
> The code in module.c looks like it implements the extension to which Ralf
> refers.
Which is useful for for branch delay slot scheduling like:
...
j 1f
lui a0, %hi16(hello)
...
j 1f
lui a0, %hi16(hello)
...
1: jal printf
addiu a0, %lo16(hello)
hello: .asciz "hello, hola\n"
The next and logical extension would be to permit multiple R_MIPS_LO16
records following a sequence of one or more R_MIPS_HI16 relocs as long as
all relate to the same symbol - which would be simple to support in the
kernel.
Ralf
next prev parent reply other threads:[~2009-08-03 23:55 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
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 [this message]
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=20090803235536.GB22543@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=ddaney@caviumnetworks.com \
--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.