view contents of shared library


 
Thread Tools Search this Thread
Top Forums Programming view contents of shared library
# 1  
Old 05-25-2006
view contents of shared library

Hi ,

i have two doubts in Hp-Ux

1) How to View objects or contents in a shared library in HP-Ux
2) Can i added a c object file to the existing shared file from a different directory .
for example :

I have two directories X and Y

I have a.o b.o c.o object files in X directory

I create a shared library
ld -b -o libx.sl a.o b.o c.o

I Have d.o in Y directory now i want to add d.o to shared libx.sl created in X directory .

ld -b -o libxl.o ../d.o ( will t


Many thanks
Narendra
# 2  
Old 05-25-2006
1. use nm <sharedlibrary> | more
2. Assuming I understand what you're saying - You need to compile your module then relink the whole shared library. Which means you need all of the source or objects used to make that library to start with. You cannot just add an object.
# 3  
Old 05-26-2006
shraed library

Hi Jim ,

Thanks for your updates Jim 1st one worked fine .

I got some info reg the 2nd one .
to be more clear
My question was whether i need to have all the source files in one place ( in same directory) and compile in same directory also having all the object files in the same directory and make a shared lib in the same directory .

in simple statement do i need to have all the c source files ,object files e and create a shared lib from object files in the same directory .


Does that mean i cannot have c source file and its object file in another directory to be added to the exiting shared library present in other directory

or It is must that i have to take the c source file and compile it in the directory where the shared librray is created with the rest of files


Ofcourse i will once again add all the .o files into shared lib when it is newly created or when a new object is created


Soory for the lengthy explanation

if anything else let me know


Many Thanks
naren
# 4  
Old 05-26-2006
You can keep all the *.o in one directory & create the shared library.
No need to keep the source in that dir.
# 5  
Old 05-26-2006
In fact, if you want to keep things neat, you can use ar to create a single file with most (or All) of your object files. ar will let you update existing objects, or add new ones.

try man ar
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

View all jar files contents in one go ?

I can view a jar file contents using the below command: $ jar -tvf ./checker-compat-qual-2.0.0.jar 0 Mon May 02 18:28:46 IST 2016 META-INF/ 184 Mon May 02 18:28:44 IST 2016 META-INF/MANIFEST.MF 0 Mon May 02 17:20:16 IST 2016 afu/ 0 Mon May 02 17:20:16 IST 2016 afu/org/ ... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. UNIX for Advanced & Expert Users

Using vim to view the contents of a directory

When I use this command: vi /home/bob/.vimI expect to see. " ============================================================================ " Netrw Directory Listing (netrw v149) " /home/bob/.vim " Sorted by name " Sort sequence:... (4 Replies)
Discussion started by: cokedude
4 Replies

3. AIX

Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message. add shr4.o shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a add shr.o shared members from /usr/lib/libiconv.a to ... (5 Replies)
Discussion started by: kneemoe
5 Replies

4. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

5. Shell Programming and Scripting

trying to view contents of an existing script

root#pwd /opt/tools root# cat check_traffic /opt/tools/utils/commands $1 /opt/tools/utils/DIR/check_traffic root# cat /opt/tools/utils/DIR/check_traffic gew "check_traffic -v" Hi above script works for checking traffic for an ip address im trying to view the check_traffic script by... (5 Replies)
Discussion started by: slashbash
5 Replies

6. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

7. Programming

Shared memory for shared library

I am writing a shared library in Linux (but compatible with other UNIXes) and I want to allow multiple instances to share a piece of memory -- 1 byte is enough. What's the "best" way to do this? I want to optimize for speed and portability. Obviously, I'll have to worry about mutual exclusion. (0 Replies)
Discussion started by: otheus
0 Replies

8. Programming

Shared memory in shared library

I need to create a shared library to access an in memory DB. The DB is not huge, but big enough to make it cumbersome to carry around in every single process using the shared library. Luckily, it is pretty static information, so I don't need to worry much about synchronizing the data between... (12 Replies)
Discussion started by: DreamWarrior
12 Replies

9. UNIX for Dummies Questions & Answers

Listing the contents of a shared Unix library

I am brand new to Unix. This is probably simple, but how do you list the contents of a shared library? I need to see which functions exist in it. Many thanks. (1 Reply)
Discussion started by: mickpoil
1 Replies

10. UNIX for Dummies Questions & Answers

Unable to view contents of a directory

Hi, first post here be gentle. Very new to Unix. Using HP-UX 10.20 I CD into a remote directory on one machine $ cd /net/remote hostname yet when I do an ll in this directory none of the contents appear. It just is empty. when I do the same command from another machine, $ cd... (13 Replies)
Discussion started by: maddave
13 Replies
Login or Register to Ask a Question