want to know

T. William Wells bill at twwells.com
Fri Aug 18 20:08:12 AEST 1989


In article <1507 at l.cc.purdue.edu> cik at l.cc.purdue.edu (Herman Rubin) writes:
: In the previous operating systems I have used, the startup procedure was
: done by the loader.  This is what is missing in UNIX; the loader does not
: have the capability to produce the startup program, so that must be explicitly
: put in.

I have worked on such systems. They are a royal pain in the ass if
you don't want to do exactly what the loader wants you to do.

Moreover, your point is irrelevant: one rarely needs to call the
loader directly. Most C compiler systems have some kind of front-end
program which handles (among many other things) the dirty work of
specifying the startup program. For all practical purposes, the
loader is called 'cc' (or something similar) and puts in the startup
program for you. Just like those old and grungy systems. Of course,
since cc isn't really the loader, if you have to do something
different, you can just call the loader directly with whatever
startup makes you happy.

On my machine, for example, if I compiled with -g, I am fairly sure
(*) I could massage the object files and produce a startup program
that knows how to call each global function in those files. I could
then link that function with my files and, there you have it, the
ability to call any function from the command line. On a UNIX system.

Of course, I'd never bother with such an absurdity.

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill at twwells.com

(*) I'm not sure if COFF files get the function argument types put
into the symbol table. If not, I rather suspect that it wouldn't be a
big deal to add this to the COFF format.



More information about the Comp.lang.c mailing list