Return-Path: owner-postman Received: from epoch.CS.Berkeley.EDU (epoch.CS.Berkeley.EDU [128.32.32.79]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with ESMTP id TAA11182 for ; Thu, 17 Aug 1995 19:44:38 -0700 Received: from epoch.CS.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by epoch.CS.Berkeley.EDU (8.6.11/8.6.3) with ESMTP id TAA28006 for ; Thu, 17 Aug 1995 19:43:30 -0700 Message-Id: <199508180243.TAA28006@epoch.CS.Berkeley.EDU> From: aoki@cs.berkeley.edu (Paul M. Aoki) To: postgres-arch@postgres.Berkeley.EDU Reply-To: aoki@cs.berkeley.edu (Paul M. Aoki) Subject: dlopen for AIX Date: Thu, 17 Aug 1995 19:43:30 -0700 Sender: aoki@postgres.Berkeley.EDU Newsgroups: comp.unix.aix From: hook@chaco.aix.dfw.ibm.com (Gary R. Hook) Subject: Re: dynamic loading routines on AIX Message-ID: Date: Thu, 16 Jun 1994 17:56:23 GMT In article <1994Jun13.121014.6678@ais.com>, rose@ais.com writes: |> |> Hi, can anybody tell me what routines on AIX do the dynamic loading? basically |> I'm looking for the corresponding routines of dlopen(), dlsym(), and dlclose() |> on SunOS, or shl_load(), shl_findsym() and shl_unload on HP-UX; I would think |> AIX uses the same set of routines as SunOS, because it's also a BSDish system, |> but I couldn't find them on our RS6000 box. AIX provides a load() function, loadbind(), and unload(). The load() function loads an object and returns a pointer to the entry point of the object (should be a function pointer). While one usually exports any symbols which should be globally available, there is no mechanism which allows you to look up by name a symbol and get a pointer to the definition. So, dlsym() or shl_findsym() don't really have a comparable version on AIX 3.x. Now then. There does happen to be an "RPQ" from IBM which implements: 1) replacable symbols within shared libraries. 2) the dl*() API for shared/loaded objects. The RPQ is implemented as a set of commands that are used to build applications in a manner which allows a runtime environment to do the symbol replacing based on command line ordering of objects. One limitation is, however, that the shared libraries must be built in this manner; thus, it still doesn't let you conveniently do things like replace malloc(), etc. Also, there is a performance hit in that the tools insert global linkage code for every symbol. This adds execution overhead for every subroutine call. Finally, the current implementation is only verified to work with xlc and xlf; no gcc, no CSet++. The end result is that these tools provide a System V-like flavor of shared library behavior. I suppose a more elaborate posting of information might be in order... The RPQ number is P91129. You have to go to your local IBM contact and ask them to request this RPQ. Unfortunately, the RPQ is I-listed, which is IBM-ese for "restricted access." So, the magic incantation is "escalate." More details at a later date... -- ________________________________________________________________________ Gary R. Hook | "It's hard to work in groups AIX Application Enabling | when you're omnipotent." IBM Corporation, Southlake, Texas | - Q in Star Trek: The Next The above opinions are all mine. | Generation -- Paul M. Aoki | University of California at Berkeley aoki@CS.Berkeley.EDU | Dept. of EECS, Computer Science Division (#1776) | Berkeley, CA 94720-1776