Overflow in relocation type 11 val FFFFFF00104c3688

24 views
Skip to first unread message

Shawn Bohrer

unread,
Apr 30, 2007, 9:51:57 AM4/30/07
to kernelnewbies
Hey everyone,

I'm trying to build one of my companies internal test modules on the
x86_64 architecture. The module is written in C++ so we do not use
the kernel's build system. When I try to load the module I see the
following error in the kernel prints:

Overflow in relocation type 11 val FFFFFF00104c3688
module likely not compiled with -mcmodel=kernel

Of course the problem is that I am compiling with -mcmodel=kernel and
-mno-red-zone. Additionally I have built one other module using the
same compile options and it loads fine. Am I missing some other
compile options? Is there something wrong with the code?

I have looked through the kernel code to see what would trigger this
error and it appears that I have a R_X86_64_32S value that overflows a
s32 but I can't seem to figure out how or where this is in the code,
or if I need another compile option to fix this. If someone could
give me some pointers it would be greatly appreciated.

Thanks,
Shawn

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Shawn Bohrer

unread,
May 2, 2007, 10:14:45 AM5/2/07
to kernelnewbies
On 4/30/07, Shawn Bohrer <shawn....@gmail.com> wrote:
> Hey everyone,
>
> I'm trying to build one of my companies internal test modules on the
> x86_64 architecture. The module is written in C++ so we do not use
> the kernel's build system. When I try to load the module I see the
> following error in the kernel prints:
>
> Overflow in relocation type 11 val FFFFFF00104c3688
> module likely not compiled with -mcmodel=kernel
>
> Of course the problem is that I am compiling with -mcmodel=kernel and
> -mno-red-zone. Additionally I have built one other module using the
> same compile options and it loads fine. Am I missing some other
> compile options? Is there something wrong with the code?
>

Well I found the problem though I'm not sure how to fix it. The
problem is that we define two symbols in our linker script and the
linker doesn't know about the -mcmodel=kernel option. Is there some
other way to do this in the linker script on 64-bit?

.ctors 0 :
{
___gNISSCtorStart___ = .;
KEEP (*(SORT(.ctors.*)))
KEEP (*(SORT(.ctors)))
___gNISSCtorEnd___ = .;
}
.dtors 0 :
{
___gNISSDtorStart___ = .;
KEEP (*(SORT(.dtors.*)))
KEEP (*(SORT(.dtors)))
___gNISSDtorEnd___ = .;

Reply all
Reply to author
Forward
0 new messages