randomgood
randomgood

Reputation: 566

Listing library functions in GCC

Is is possible to list all the library functions available in any library/headers in GCC command line? Anything similar to program like JAVAP which is available for Java? Thanks.

Upvotes: 4

Views: 3525

Answers (1)

Guy
Guy

Reputation: 2042

You can use objdump to list symbols in a shared libraries (or executables):

$objdump -T /usr/lib/libclang.so
<...snipped...>
0000000000124150 g    DF .text  00000000000000c1  Base        clang_reparseTranslationUnit
000000000010fe40 g    DF .text  0000000000000021  Base        clang_getNullRange
0000000000135760 g    DF .text  000000000000009f  Base        clang_getPointeeType
0000000000124290 g    DF .text  0000000000000289  Base        clang_parseTranslationUnit
000000000012b790 g    DF .text  0000000000000935  Base        clang_findReferencesInFile
0000000000110b80 g    DF .text  000000000000001c  Base        clang_getRangeEnd
0000000000127d20 g    DF .text  0000000000000022  Base        clang_disposeCodeCompleteResults
0000000000135e10 g    DF .text  0000000000000037  Base        clang_isPODType

000000000010f870 g DF .text 0000000000000025 Base clang_getTranslationUnitCursor 0000000000129b50 g DF .text 00000000000002c1 Base clang_getDiagnosticOption

As you can see it lists the different symbols and their relative address.

Upvotes: 1

Related Questions