Shared system routines

stephen at alberta stephen at alberta
Sat Jul 23 17:20:58 AEST 1983


.nh
.ad l
    It has bothered me for a while that every time I compile a C
program, of the routines which I use are physically added to the
object file.  When you consider that many of the routines are
included in almost every object file, perhaps it would be better
to share one copy of the more common routines between all tasks.

    The most obvious advantage of this approach would be the
savings in disk space. As an example: On our system, with about
1200 object files, the savings from sharing the startup routines
and PRINTF (apx 7k per file) would come to about 9meg.  Sharing
routines would also result in decreased memory usage and possibly
faster loading times (since only the user routines would have to
be loaded).

    Those subroutines used by the kernel would have to be
designated as shared non-paged, and others could be simply
shared.

The big question is how easy would it be to make the change?
Memory management would have to be modified, the loader, and
possibly things like 'adb' as well. And where would the
routines be placed? If they are put at the bottom of memory,
would this cause problems with routines that didn't expect them
there? And if they are placed at the top of memory, would that
cause problems with ADB and CDB or get in the way of the stack? I
don't yet know enough about UN*X to really answer those questions
well.

    Does it sound like a feasible Idea or am I out in left field?

		Stephen Samuel 
		(ubc-visi!alberta!stephen)



More information about the Comp.unix.wizards mailing list