Wierd code

johnl at ima.UUCP johnl at ima.UUCP
Mon Nov 4 13:54:00 AEST 1985


> An #ifdef VAX would be superfluous here.  The loader is one of the more
> machine dependant parts of any system.  

Assuming you mean the linker, that's not true at all.  At Interactive
Systems, we came up with a common object format for all of the byte-
addressable machines we were working on and a single linker that could
link for any of them.  PC/IX and VM/IX really use the same linker, and
(except for bugs and perhaps old versions) either linker can link code
for either machine.  Also, there is a single version of nm, strip, and
so forth, which makes life much easier.  It turned out to be easier than
I would have thought, since there seem only to be about a dozen different
kind of link-time fixups that any of the machines we know about need.  A
moderate number of flags, usually passed in from "cc", proved adequate to
deal with the various forms of split I/D, segmented addressing and so forth.

More work would be needed if we were going to move to, say, shared libraries
or dynamic linking, but we thought of reasonable ways to deal with that.
There is a paper on the common object format and its tools in one of the
Usenix proceedings from about two years ago.

John Levine, ima!johnl

PS:  I figured this would be really great in a system with, say, a 68000
and a 286, where each object module would automatically be run on the
processor it was linked for.



More information about the Comp.unix.wizards mailing list