+4  A: 

I think nm -D is what you're looking for.

$ nm -D /usr/lib/libpng.so
...
00000000000058f0 T png_reset_zstream
000000000000d420 T png_save_int_32
000000000000d450 T png_save_uint_16
000000000000d3f0 T png_save_uint_32
0000000000007810 T png_set_IHDR
0000000000007500 T png_set_PLTE
000000000000ce20 T png_set_add_alpha
0000000000006670 T png_set_asm_flags
0000000000006970 T png_set_bKGD
000000000001a740 T png_set_background
...
Jack Kelly
@Jack Kelly-I have created a dynamic library(lib*.so file) and added a few functions in it.so i need a command line that would display its contents.(i.e the functions)
Pavitar
A: 

The nm -D command lists the dynamic symbols of your shared library, what seems to exactly what you want.

pidm
+4  A: 

use nm -D --defined-only libname.so to get the symbol name your dynamic library.
The --defined-only switch shows you only the symbol that are defined in this files, and not references to external functions.

An alternative is to use objdump, and catch only the symbols in the text section :

objdump -T /usr/lib/libjpeg.so | grep text
...
0001b5c0 g    DF .text  00000016  Base        jdiv_round_up
00003730 g    DF .text  00000417  Base        jpeg_set_colorspace
0000cda0 g    DF .text  000002de  Base        jpeg_consume_input
00002b30 g    DF .text  00000023  Base        jpeg_abort_compress
00003b50 g    DF .text  000000b6  Base        jpeg_default_colorspace
00002810 g    DF .text  00000067  Base        jpeg_suppress_tables
00004110 g    DF .text  00000130  Base        jpeg_add_quant_table
000100c0 g    DF .text  0000011f  Base        jpeg_save_markers
...
shodanex
This should be the accepted answer.
Jack Kelly
@Jack Kelly: The objdump util seems more comprehensive, but what's the difference wrt to the OP?
Matt Joiner
@Matt Joiner: The difference between this answer and mine is the reference to `nm -D --defined-only`. `nm -D` will display undefined symbols and so on, which is just noise if you want to see what the lib itself defines.
Jack Kelly