LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 04-25-2006, 11:10 AM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
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?
 
Old 04-25-2006, 11:27 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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
 
Old 04-25-2006, 04:59 PM   #3
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
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.
 
Old 12-02-2009, 01:44 AM   #4
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Rep: Reputation: 36
Quote:
Originally Posted by nx5000 View Post
You can use
nm -Ca /lib/mylib.so.1
man nm for full
For the shared libs:
Code:
nm -D /lib/mylib.so.1
 
Old 10-24-2011, 12:46 AM   #5
kamatchisl
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
View Functions inside Library

Hi,
I'm too facing the same problem now.
Did u get any solution for this.
 
Old 10-24-2011, 01:31 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@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.
 
Old 10-24-2011, 01:42 AM   #7
kamatchisl
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
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
 
Old 10-25-2011, 04:47 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 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 ? ).

.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to step through function in shared object library using gdb markhod Programming 2 01-03-2009 02:00 AM
gets library function in C reddazz Programming 3 03-27-2005 02:04 AM
help shared library jingle_mj Linux - General 1 08-13-2004 03:11 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
what is the function library of the basic graphics library in rethat9.0? zerwolve Red Hat 0 04-29-2004 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration