Wierd code
Henry Spencer
henry at utzoo.UUCP
Thu Oct 31 11:30:14 AEST 1985
> An #ifdef VAX would be superfluous here. The loader is one of the more
> machine dependant parts of any system. Not only does it depend on the
> format of your relocatable files, but it depends on both the hardware
> instruction set and the memorym management system being employed. Even
> who loaders for the same microprocessor would therefore be substatnially
> different if they had dissimilar memory schemes.
Actually, by using a reasonably powerful and flexible object-module format,
like the IEEE P695 proposal, it is quite possible to build a machine-
independent loader. (It's been done, for a version of P695.) The loader
doesn't have to know that 010537 means "mov r5, $#something", all it has
to know is how it should adjust the number for relocation and linking.
The variety of approaches to that is non-trivial, but much smaller. Even
when one must cope with existing object-file formats which lack the needed
flexibility, it is still silly to introduce gratuitous unportability into
code which can be *mostly* machine-independent.
(Reference: a draft of P695 was published in the August 1983 issue of
IEEE Micro. See that for further information.)
(Oh yes, to head off anyone suggesting that the /usr/group / IEEE Unix
standards effort should have had P695 brought to its attention: I did.
The consensus was that investment in existing object-module formats is
too heavy to expect changes. I still think that much could be accomplished
in this direction if an influential standards body gave new Unix ports
a firm push that way. Easier said than done, alas.)
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
More information about the Comp.unix.wizards
mailing list