The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
static and shared libraries JamesByars UNIX for Advanced & Expert Users 2 01-13-2008 02:29 PM
Shared Libraries wojtyla Linux 1 09-16-2005 01:14 AM
Clarification about shared Libraries ramkumar_gr UNIX for Dummies Questions & Answers 3 11-17-2003 07:59 AM
shared libraries thalex High Level Programming 2 11-29-2001 09:32 AM
Shared libraries Micky High Level Programming 0 11-12-2001 04:25 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-13-2007
p.premkumarr p.premkumarr is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 2
need help in working with shared libraries on hpux

hi,
i am having problem loading multiple shared libraries. if i load, make call to exposed method and then unload them, everything workds fine, but i have to keep the loaded images in memory,

i am uploading the prog. as loader.zip, it contains

loader - loader.c which loads c++ shared libraries service1.sl, service2.sl and service3.sl into memory and initilises them

support - a c++ archive library which contains the common support needed for all the services, the loader makes call to a exposed method in support.cpp, HookFun namely..

support.h has a macro defines as EXT_INTERFACE which is smart, when a service says EXT_INTERFACE('servicename'), it expands to something like this

long interface(){
servicename serviceinstance;
servicename.CallService();
}

and the HookFun makes and instance of support class which inturn calls interface(), where an instance the required service is created.

services/service* - services, shared libraries build using the support archive, and loaded by the loader

problem:
case 1)
when i load service1, make a call to initilize the service and then unload it, load service 2 make a call and then unload it, ....

everything is fine.

case 2) if i load service1, make a call to initilize the service (dont unload it), load service 2 make a call to initilize it, but this time service 1 is getting initilized again, service 1 is initilized as many services are there..

(my requirement is that i have to keep all the serivces in mermory at the same time)

output for first case:

The address of the loaded function is 2139010832
the buffer content is service1.sl
got addre for proc and it is 2138878086
Dispatch function called with name service1.sl
Support initilizing
Initilizing class service 1
Service called for service1
The address of the loaded function is 2139010832
the buffer content is service2.sl
got addre for proc and it is 2138878070
Dispatch function called with name service2.sl
Support initilizing
Initilizing class service 2
Service called for service 2
The address of the loaded function is 2139010832
the buffer content is service3.sl
got addre for proc and it is 2138878086
Dispatch function called with name service3.sl
Support initilizing
Initilizing class service 3
Service called for service 3

output for second case: (removed shl_unload)
The address of the loaded function is 2139010832
the buffer content is service1.sl
got addre for proc and it is 2138878086
Dispatch function called with name service1.sl
Support initilizing
Initilizing class service 1
Service called for service1
The address of the loaded function is 2139012144
the buffer content is service2.sl
got addre for proc and it is 2139003802
Dispatch function called with name service2.sl
Support initilizing
Initilizing class service 1
Service called for service1
The address of the loaded function is 2139012472
the buffer content is service3.sl
got addre for proc and it is 2139004250
Dispatch function called with name service3.sl
Support initilizing
Initilizing class service 1
Service called for service1

the code i have attached is very simple, please let me know where i am going wrong.. i am executing the program on hpux 10.0 machine and it is patches properly.

thankx in advance
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0