Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-25-2006, 11:10 AM
|
#1
|
|
Member
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276
Rep:
|
list library function of a shared library .so
I like to find out what functions of a shared library xxx.so has (i.e. list the function names and parameters). How to do that?
|
|
|
|
04-25-2006, 11:27 AM
|
#2
|
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
You can use
nm -Ca /lib/mylib.so.1
man nm for full
But I doubt you will find the parameters of the functions. You would need to inspect the asm code and look at how the stack moves. It would tell you the size of the parameters, not the type which has no meaning in an object file
|
|
|
|
04-25-2006, 04:59 PM
|
#3
|
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
|
(i.e. list the function names and parameters). How to do that?
|
You can see the parameters by reading the man page(s) (or the src). They are not in the library.
|
|
|
|
12-02-2009, 01:44 AM
|
#4
|
|
Member
Registered: Nov 2008
Posts: 180
Rep:
|
Quote:
Originally Posted by nx5000
You can use
nm -Ca /lib/mylib.so.1
man nm for full
|
For the shared libs:
Code:
nm -D /lib/mylib.so.1
|
|
|
|
10-24-2011, 12:46 AM
|
#5
|
|
LQ Newbie
Registered: Jul 2011
Posts: 4
Rep: 
|
View Functions inside Library
Hi,
I'm too facing the same problem now.
Did u get any solution for this.
|
|
|
|
10-24-2011, 01:31 AM
|
#6
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,603
|
@kamatchisl.
The three usual tools can be used for objects : nm, objdump, readelf.
Random examples ...
readelf -s /usr/lib/lib<example>.so.XX.x | grep <OBJECT_abc>
objdump -Dslx /lib/libcap.so.2 | more
objdump -x /path/to/file/filename | head -50
Functions / parameters , see post 2-3-4
..
Last edited by knudfl; 10-24-2011 at 01:37 AM.
|
|
|
|
10-24-2011, 01:42 AM
|
#7
|
|
LQ Newbie
Registered: Jul 2011
Posts: 4
Rep: 
|
Hi thanks for ur reply.
But through the commands i could get only the method names not the return type
Could anyone help me on getting the return type of method inside library
|
|
|
|
10-25-2011, 04:47 AM
|
#8
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,603
|
# 7 : Generally :
Do not expect any answers, when you ask in an old thread.
Suggest : Start a new thread
http://www.linuxquestions.org/questi...ux-software-2/
>>> 'New Thread'
Not being a programmer, I don't know what you mean by "return".
( You may have to read the source code for the library ? ).
.
|
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:19 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|