Question about kld modules

Alex RAY ray at ddteam.net
Thu Feb 11 20:33:57 UTC 2010


On Thu, 11 Feb 2010 11:05:47 -0800
Oleksandr Tymoshenko <gonzo at bluezbox.com> wrote:

> Alexandr Rybalko wrote:
> > Someone have luck in loadable modules support on MIPS port?
> 
> I tried to but failed. First, we have a little mess with LDFLAGS, but
> you've already found it out :) :
> http://lists.freebsd.org/pipermail/freebsd-arch/2009-October/009687.html
> 
> Then there were problems with linker itself, it assumed some addresses
> for relocations to be NULL and dropped these relocations while
> producing final object file. Need to re-do this to recall actual
> details.
> 

I thing it`s time to update gcc or help to write MIPS support for "clang" :)
When I dig about troubles with CALL16 in module make, I found what gcc have patch in 4.3.x which fix that bug.
But we have 4.2.1 now. 
Also I can replace usage R_MIPS_REL32 with R_MIPS_32 to avoid KLD linking errors, but I thing this may by fixed with gcc/binutils update.
And more recent version have support -fstack-protector on MIPS.

Return to our modules.
When I replace R_MIPS_REL32 with R_MIPS_32, module pass linker checking, but crash on linker_load_dependencies
(kern_linker.c:2042)
In first iteration of for, after `mp = *mdp;`, at this point in `mp` we have address like 0x5xxxxx 
(but this is badaddr(0x5xxxxx)), so at next instr (mp->md_type != MDT_VERSION) we have trap :(
Who responsible about right KLD load address, kernel or ld? 



-- 
Alex RAY <ray at ddteam.net>


More information about the freebsd-mips mailing list