dave@sdeggo.UUCP (David L. Smith) (04/02/88)
I've been considering writing some nifty stuff in C++, but I ran into a problem on one part of the (so far theoretical) implementation. When an object containing member functions is written out to the disk and then read back in at a later time, I assume that the binary image is read back into memory. This has problems, however, if the program has been recompiled and the locations of the code for the member functions have changed. Has anyone dealt with this problem or the more general one of dynamically loading and linking objects and their associated member functions? -- David L. Smith {sdcsvax!jack,ihnp4!jack, hp-sdd!crash, pyramid, uport}!sdeggo!dave sdeggo!dave@amos.ling.edu Sinners can repent, but stupid is forever.
keith@nih-csl.UUCP (keith gorlen) (04/03/88)
In article <187@sdeggo.UUCP>, dave@sdeggo.UUCP (David L. Smith) writes: > When an object containing member functions is written out to the disk and > then read back in at a later time, I assume that the binary image is > read back into memory. This has problems, however, if the program has > been recompiled and the locations of the code for the member functions have > changed. Has anyone dealt with this problem or the more general one of > dynamically loading and linking objects and their associated member functions? My Object-Oriented Program Support (OOPS) class library handles general-purpose object I/O. The technique is described in the paper "An Object-Oriented Class Library for C++ Programs", Software -- Practice and Experience, Vol. 17(12), 899-922 (December 1987). This paper was reprinted in the proceedings of the First USENIX C++ Workshop. Also published in the proceedings is a paper entitled "Two Extensions to C++: A Dynamic Link Editor and Inner Data" by Phillippe Gautron and Marc Shapiro. I believe that the GNU C++ compiler will support dynamic linking. Also, Bart Miller (bart@speedy.WISC.EDU) once posted something about implementing dynamic linking in C++ -- see the 1987 OOPSLA proceedings. -- Keith Gorlen phone: (301) 496-5363 Building 12A, Room 2017 uucp: uunet!ncifcrf.gov!nih-csl!keith National Institutes of Health Internet: keith%nih-csl@ncifcrf.gov Bethesda, MD 20892