Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2010 22:33:36 +0200
From:      Alex RAY <ray@ddteam.net>
To:        Oleksandr Tymoshenko <gonzo@bluezbox.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Question about kld modules
Message-ID:  <20100211223336.650f22dd.ray@ddteam.net>
In-Reply-To: <4B74550B.8020505@bluezbox.com>
References:  <20100211180129.b34a95c9.ray@dlink.ua> <4B74550B.8020505@bluezbox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 11 Feb 2010 11:05:47 -0800
Oleksandr Tymoshenko <gonzo@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@ddteam.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100211223336.650f22dd.ray>