Appending to executables.

PAD Powell padpowell at wateng.UUCP
Wed Oct 17 22:24:10 AEST 1984


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



More information about the Comp.lang.c mailing list