[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.LFD.2.00.1101270030220.8580@xanadu.home>
Date: Thu, 27 Jan 2011 00:43:54 -0500 (EST)
From: Nicolas Pitre <nico@...xnic.net>
To: Sachin Verma <imschnvrm@...il.com>
Cc: Russell King - ARM Linux <linux@....linux.org.uk>,
Rabin Vincent <rabin@....in>,
Alexander Holler <holler@...oftware.de>,
Dave Martin <dave.martin@...aro.org>,
lkml <linux-kernel@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
catalin.marinas@....com
Subject: Re: ARM: relocation out of range (when loading a module)
On Tue, 25 Jan 2011, Sachin Verma wrote:
> Hello,
>
> On Thu, Jan 13, 2011 at 12:25 AM, Nicolas Pitre
> <nicolas.pitre@...aro.org> wrote:
> > On Wed, 12 Jan 2011, Russell King - ARM Linux wrote:
> >
> >> As the overall feeling at the time was "don't use large initrds" it's
> >> something I've never really cared about - and I'm still of the opinion
> >> that 16MB of compressed initrd/initramfs is rather silly.
> >
> > It is... but we have more than 32MB of RAM total now, and people are
> > running standard distributions on ARM these days, such as Fedora or
> > Ubuntu, including their corresponding initrd that may contain lots of
> > modules, splashscreen data, etc. So it might be a good idea to think
> > about fixing this limitation before it comes back again.
> >
>
> in fact it is not just the initrd/initramfs size, i am facing issues
> with loading modules on MMU-less envt(Cortex M3).
> I have 128MB of Physical RAM and i am using a 4MB initrd to boot my
> system. when i try to load kernel modules i get relocation errors.
> As MMU-less systems are allowing modules to be loaded anywhere from
> RAM and not from any predefined limits of MODULES_VADDR and
> MODULES_END.
>
> Do you have any pointers on how to tackle this situation for MMU less
> environments?
The MMU-less kernel should still favor allocations close to the kernel
text for modules, and anything else away from the kernel going
downwards.
Otherwise a veneer should be created by the module symbol resolver such
that if the branch distance to reach, say, printk is too large, then the
following code would have to be dynamically generated right next to the
module:
ldr pc, [pc, #-4]
.word <far_away_symbol>
Then, in your module, you patch the branch relocation for printk so that
it branches to the code above instead, and then store the address of
printk at the location represented by the .word directive.
Nicolas
Powered by blists - more mailing lists