To put the RPC code into a shareable library, if you are not using CATS, you should remove the INIT_CATS module from your copy of the library. Otherwise, a LIB$INITIALIZE psect will be generated.

If you have C client stubs in the shareable library, then you will find that the handle used by the client (h_xxxx) is declared global (ie not static). This causes it to be put in a common block, inside the sharable library. Putting "static" in front of its declaration will have it put into a process-local data area.

Thanks to Christian Boissat for these two points.