From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b3cc53a4cd752b49 X-Google-Attributes: gidfee84,public From: john hall Subject: Re: Wrappers for shared library functions? Date: 1997/03/06 Message-ID: <331EB4EA.2A0@netcomuk.co.uk>#1/1 X-Deja-AN: 223410078 References: <331D5BCE.5329@netcomuk.co.uk> Organization: NETCOM Internet Ltd. Newsgroups: comp.unix.osf.osf1 I (john hall) wrote: > > I would be very grateful for any advice on how to create "wrappers" for > one or two functions in large shared libraries, Apologies for adding to my post,....... I should have stated that this is for OSF/1 /DU v2.x, v3.x and v4.x. I do not have sources for either the calling applications or the libraries (e.g. libm.so) - hence the need for "transparency". I've tried renaming an existing library file and creating a replacement dummy library which has the renamed real one as a dependency. However, the loader is unable to resolve symbols contained in the renamed real library. It appears that the name of the shared library is also stored in the library file itself. As a consequence, although the renamed shared library file (e.g. libRenamedReal.so) is found by ld when creating the "dummy" libReal.so, the dependencies of the dummy library (revealed through odump -Dl) include the name "libReal.so" instead of "libRenamedReal.so". Hence the loader appears never to try and load libRenamedReal.so when loading the dummy libReal.so, even though ld had to check against symbols it contains when creating the dummy. Humph. Archived newsgroup articles on this topic suggest that a library preload technique can be used on Solaris, but I have not been able to locate any equivalent on DU. regards john hall