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

Nathan Hawkins utsl@quic.net
Sat, 6 Dec 2003 11:35:47 -0500


On Sat, Dec 06, 2003 at 04:11:06PM +0100, Robert Millan wrote:
> On Fri, Dec 05, 2003 at 11:25:25PM +0100, Santiago Vila wrote:
> > 
> > # tar jtvf gnu-knetbsd.tar.bz2 ./lib/ld.so.1
> > lrwxrwxrwx root/root         0 2003-12-04 22:23:44 ./lib/ld.so.1 -> l
> > 
> > Warning: this tarball suffers from the "mysterious symlink bug" and
> > it's probably unusable.
> 
> 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

Contents of section .interp:
 80480f4 2f6c6962 2f6c642d 6c696e75 782e736f  /lib/ld-linux.so
 8048104 2e3200                               .2.             

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.

	---Nathan