Subject: Re: kernel linking with binutils 2.8
To: None <jonathan@DSG.Stanford.EDU>
From: Arne Henrik Juul <>
List: port-pmax
Date: 05/22/1997 09:13:53
Jonathan Stone writes:

> Thanks for the ldscript. I'm now running a kernel linked with your
> ldscript and binutils 2.8, after recompiling half a dozen files with
> -G 0. The updated pmax/conf/Makefile.pmax and mips/conf/kern.ldscript
> will appear in the official sources just as soon as I know what
> copyright to put on the ldscript.

eh... public domain?  It's written by reading the docs, then taking
the default linker script and yanking out things I think isn't needed,
and I don't feel any need for claiming ownership of it, really :-)

> I'm going to stick with
> 	GP?=	-G 0
> until we understand how extern references from LKMs to data in the
> kerne's .sbss/.sdata segments can be resolved.  It's easy enough to
> override, though.

This should work as long as LKMs are compiled with -G 0.  Compiling an
LKM with any other -G option would require us to reserve a portion of
address space after .sbss (or maybe between .sdata and .sbss, yuck)
where the LKM's .sdata and .sbss section would go, if it has any.

I'm pretty sure that it's not a problem to link LKMs compiled with -G
0 into a kernel that's compiled with -G 8, since the LKM references
data in the kernel, not the other way around.

> Does -G 8 really work without defining __GP_SUPPORT__?  Weird...

Probably not :-) but gcc defines that by default; I didn't change
anything to get it.