Messages in this thread | | | Date | Tue, 11 Jan 2011 15:57:31 +0000 | From | Russell King - ARM Linux <> | Subject | Re: 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.
| |