Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site wateng.UUCP
Path: utzoo!watmath!wateng!padpowell
From: padpowell@wateng.UUCP (PAD Powell)
Newsgroups: net.lang.c
Subject: Re: Appending to executables.
Message-ID: <1550@wateng.UUCP>
Date: Wed, 17-Oct-84 08:24:10 EDT
Article-I.D.: wateng.1550
Posted: Wed Oct 17 08:24:10 1984
Date-Received: Sun, 21-Oct-84 05:13:30 EDT
References: <>, <404@ncoast.UUCP>, <261@lzmi.UUCP>
Organization: U of Waterloo, Ontario
Lines: 18

In the past, I posted to net.sources a set of routines that allowed dynamic
loading of object code into an executable.  The technique requires:
1.  program must know or be able to find the name or the executing text (code)
	file.
2.  be supplied the names of the functions to be loaded.
3.  an object file or library containing functions.

It is done by:
1.  invoking ld with special flags that cause a file to be generated containing
	all the referenced functions.
2.  allocating memory using malloc(3) or sbrk(2) to hold the new functions
3.  reading the new functions into the allocated area.

If there is interest, I will repost to the net.  The current version is for
BSD4.2,  and needs only to be recompiled to run under BSD4.1, and to have
the loader output file format lookup routines modified to run under SV

Patrick Powell