Subject: ld.so sources?
To: Castor Fu <castor@geocast.net>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-mips
Date: 03/25/1998 12:57:59
>I'm working on a port of NetBSD to a big-endian mips system, using
>the pmax port as a starting point, and I'm a little confused by
>the way dynamic loading is handled.

In general, the pmax port is a bad model to emulate. 

If you're doing a mipseb port, then contacting the newsmips people is
probably a good idea.  They're actively working on better, cleaner
code for SPLs, for machines which dont have all the weird DEC
motherboard interrupt-control registers.

Yesterday's sysconf.[ch] "platform" support in the pmax port, and the
corresponding style in sys/arch/pmax/pmax/dec_*.c, and autoconf.c and
machdep.c, would make good starting points.  Very little else is worth
copying.

The pmax iobus support and autoconfig support is still in a
prehistoric state: the iobus design was closely copied from how the
Alpha port was, years ago.  Our understanding of the "right" way to
use autoconfig and how to set up io buses has changed enormously since
then. The pmax port is being reworked to reflect that; then we need to
add add bus_space and bus_dma support.  I may get that done
by the end of spring  break; maybe not.

If you want to piggy-back off the existing MI bus support and drivers
(ISA, EISA,, VME, ...) then using the Alpha port as a style guide is a
very good idea.

>It doesn't look like the loader which is in src/libexec/ld.elf_so 
>is the one used by the pmax port.  


"in a couple of days". The mips port of ld.elf_so is completed, is in
use on developer's systems, on both big and little endian, and should
be in the tree within days.  Early access can be arranged.

The only remanining niggle is that the exising ld.elf_so has never
really been MI.  It contains a fair bit of alpha-specific hair, like
64-bit-ness and Alpha-specific relocs. We're waiting for feedback on
how best to clean those up, or if (for now) inline ifdefs are
acceptable.


>I would guess it's actually the OpenBSD loader from looking at the bits,
>but I don't see that in the source tree.

Not quite, they're both slightly different versions of (an older
release of) the GNU glibc ld.so.