Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ARM kernel module supported reloc types




On Dec 18, 2008, at 10:44 PM, Rafal Boni wrote:

On Thu, Dec 18, 2008 at 09:35:02PM -0800, Matt Thomas wrote:
Yes.  PC24 is not appropriate in dynamic shared library loading but
since kernel modules are simple .o files, it is appropriate.

Ok, so the next hole I fall into is symbols being too far for the PC24
reloc to resolve (printf in the example modules), and a crash related
to the auto-loading of the compat module.

If the branch is too far, you need to "trampolines" at the end of
the text section which, for each symbol, will do

symbol: ldr pc, . - 4
        .word   <absaddr of symbol>

printf: 0xe51ff004
        <printf addr>


The second one I haven't dug into very much (it gave me a reason to give up for the night), but the first is interesting -- in the old LKM frame- work, the lkmtramp.awk scripts generated trampoline code for all targets of PC24 relocs... do we have an equivalent for the new modules? Where is
this supposed to happen in the new world order?

no need, we can have the loader do the above instead.


Home | Main Index | Thread Index | Old Index