Path: utzoo!yunexus!geac!torsqnt!news-server.csri.toronto.edu!mailrus!umich!samsung!cs.utexas.edu!rice!sun-spots-request From: chuck@morgan.com (Chuck Ocheret) Newsgroups: comp.sys.sun Subject: dynamic loading under SunOS 4.1 Keywords: SunOS Message-ID: <8246@brazos.Rice.edu> Date: 29 May 90 15:08:11 GMT Article-I.D.: brazos.8246 Sender: root@rice.edu Organization: Sun-Spots Lines: 28 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 9, Issue 188, message 4 I,ve read the discussion of shared libaries and the man pages for dlopen(), dlsym(), etc..., ld, a.out and more and have still not resolved the proper way to accomplish dynamically loading object code into an executing process. Here is how I do it under 4.0.x: 1. Create the .o file that I want to dynamically load in. 2. From the running process run ld with the -A option for incremental loading. This gives me the size of the incremental a.out file. 3. Allocate space for the a.out file. 4. Run ld -A again to relocate the a.out file to the allocated space. 5. Read the a.out file into the allocated space. 6. Invoke nlist(3) to get addresses of entries in the symbol table. The problem with this under 4.0.x is that I have to link statically and I have to link twice. Does anyone have a recipe for how to do this under 4.1. I am hoping to avoid the time-consuming double static link. Please e-mail directly to me and I will summarize. I will also post the code that results for the information I receive. Thanks, +------------------+ Chuck Ocheret, Sr. Staff Engineer +-----------------+ | chuck@Morgan.COM | Morgan Stanley & Co., Inc. | (212) 703-4474 | | Duty now ... |19th Floor, 1251 Avenue of the Americas| for the future. | +------------------+ New York, N.Y. 10020 USA +-----------------+