lkml.org 
[lkml]   [2011]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ARM: relocation out of range (when loading a module)
On Tue, Jan 11, 2011 at 04:17:24PM +0100, Alexander Holler wrote:
> Thinking a bit more about that (for me unexcpected) "relocation out of
> range" error when loading a module, I'm curious if there could be other
> conditions which would lead to that error. Especially conditions which
> could be generated by the userspace or remote from some network.

It's purely about the relative position of the kernel text to the module
text. Nothing outside of the compilation of the kernel will affect it.

It's all to do with the branch instructions in modules having a limited
range.

We generally place the kernel such that it starts 32K into the kernel's
system RAM mapping. We place modules immediately below this mapping.
The initramfs image sits in the kernel body in the startup data, which
sits between the startup text at the beginning of the kernel, and the
main kernel text which follows.

We _could_ rearrange the placement of these sections within the kernel
image to eliminate the problem, but it's not a simple matter to just
rearrange them - there's various assumptions made about the current
arrangement. There's also considerations over whether that would cause
additional memory to be wasted due to the alignment requirements of the
various sections, and whether it would degrade the ability to get
DMA-able memory on certain platforms.


\
 
 \ /
  Last update: 2011-01-11 17:01    [W:0.122 / U:1.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site