linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Roland McGrath <roland@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Helge Deller <deller@gmx.de>,
	linux-parisc <linux-parisc@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: kernel segv with 2.6.31-rc6 ?
Date: Tue, 18 Aug 2009 18:54:21 -0600	[thread overview]
Message-ID: <1250643261.18426.8.camel@mulgrave.site> (raw)
In-Reply-To: <20090819001424.4C1144730F@magilla.sf.frob.com>

On Tue, 2009-08-18 at 17:14 -0700, Roland McGrath wrote:
> > Actually, for parisc, its not reasonable.  It's expected that our modules
> > have multiple text sections (we have to use -ffunction-sections to
> > generate them in order that the PCREL17 jump stubs can be interleaved).
> 
> I don't think you need what you think you need.  Having lots of sections in
> your .o's when you compile is fine.  These should be combined by the linker
> script that creates the .ko, however.  Unless I am missing something, there
> is no purpose to this section distinction at insmod time--it's only
> important for the relative layout of the parts of the .ko's text, which
> winds up contiguous whether laid out that way at ld -r (.ko creation) time
> or at insmod time.

Actually, I think we do; the module loader is a runtime linker, after
all.  We have specific module bugs we fixed by inserting relocation
stubs between the text sections.

Our specific problem is that the standard pa relocation is PCREL17 ...
as you can appreciate, 17 bits of relative jump isn't a lot.  If the
target isn't within the 17 bits, we have to insert a relocation stub to
do an indirect absolute jump thought the GOT.  Our problems occur when a
text section is wider than the 17 bits, which happens a lot in the
larger modules ... with nowhere to put the stub within range of the
relocation we can't load them.  Our fix is to split the text sections
with -ffunction-sections so we can be pretty much assured of having a
stub location within the 17 bits.

We don't care what they're called or anything.  We just care that
the .text is split up into multiple separately relocateable sections so
we can get the stubs within range of the jumps.

Now, of course, if the final linker could be persuaded to sprinkle
needed stubs through the text section and all we have to do is GOT
relocations, we don't need all the jiggery-pokery ... but I'm told this
can't be done.

James



  reply	other threads:[~2009-08-19  0:54 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 21:31 kernel segv with 2.6.31-rc6 ? Helge Deller
2009-08-17 22:04 ` James Bottomley
2009-08-17 22:49 ` James Bottomley
2009-08-17 23:54   ` Roland McGrath
2009-08-18  3:18   ` Rusty Russell
2009-08-18  3:55     ` James Bottomley
2009-08-18  5:06     ` Roland McGrath
2009-08-19  0:09       ` James Bottomley
2009-08-19  0:14         ` Roland McGrath
2009-08-19  0:54           ` James Bottomley [this message]
2009-08-19  1:31             ` Roland McGrath
2009-08-19  1:38               ` James Bottomley
2009-08-19 18:10                 ` Roland McGrath
2009-08-25  7:59                 ` Rusty Russell
2009-08-25 19:24                   ` Roland McGrath
2009-08-26 12:20                     ` Rusty Russell
2009-08-26 17:54                       ` Roland McGrath
2009-08-20 11:51         ` Helge Deller
2009-08-20 12:25           ` Helge Deller
2009-08-20 18:55             ` John David Anglin
2009-08-20 21:45               ` Helge Deller
2009-08-20 21:50                 ` James Bottomley
2009-08-20 22:07                   ` Roland McGrath
2009-08-20 23:01                   ` John David Anglin
2009-08-20 23:23                     ` Roland McGrath
2009-08-21  0:03                       ` John David Anglin
2009-08-25 21:49             ` Mike Frysinger
2009-08-25  7:37         ` Rusty Russell
2009-11-27 22:11           ` Helge Deller
2009-11-30  4:41             ` Roland McGrath
2009-08-20 11:58   ` Helge Deller

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=1250643261.18426.8.camel@mulgrave.site \
    --to=james.bottomley@hansenpartnership.com \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=rusty@rustcorp.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).