[Glibc-bsd-devel] Re: GNU/KNetBSD self-hosting

Robert Millan zeratul2@wanadoo.es
Sat, 6 Dec 2003 21:38:05 +0100


On Sat, Dec 06, 2003 at 11:35:47AM -0500, Nathan Hawkins wrote:
> > 
> > It should still work, since for some reason gnu ld.so.1 is merely decorative
> > in our port :)
> > 
> > No, really, I tested it (although not very extensively). You can test it in a
> > chroot if you're unsure.
> 
> Hmm. Does ld.so.1 not work, or is ld setting the wrong interpreter on
> the executables? Best way to check:
> 
> $ objdump -j .interp -s /bin/ls

Yep, it is there but not being used.

IIRC, invoking ld.so explicitly resulted in something really weird (sigsev,
sigbus, or even sigill).

> If this is set to the native loader, that would make it seem that the
> glibc ld.so is decorative. IIRC, the default is controlled in ld, but
> you can override it with the right linker option.
> 
> I also seem to remember that on FreeBSD, the glibc and native loaders
> were somewhat interoperable. (Which makes sense, if you think about it.
> They both do the same thing, and both use ELF.) I didn't test that
> extensively, though, so there could be some obscure bugs.

On KNetBSD it's different. The NetBSD loader seems to be a residual hack
for older (a.out?) binaries. My impression is that dynamic loading is
handled by the kernel of NetBSD.

I haven't bothered to investigate this though, since at the end dynamic
executables work properly.

-- 
Robert Millan

"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."

 -- J.R.R.T, Ainulindale (Silmarillion)