Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For PE executable, I can list the imported symbols using

dumpbin /imports FILE.EXE

or using the depends utility which is GUI application.

`nm ELF-binary' just returns "no symbols".

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Try objdump -T 'ELF-file'

share|improve this answer
    
I thought objdump -T worked mainly on shared libraries... –  jim mcnamara Jul 9 '10 at 14:35
    
well... not really, if I do: objdump -t /bin/ls it returns: "SYMBOL TABLE: no symbols", with -T (which lists DYNAMIC SYMBOL TABLE) outputs a lot of data, like: "00000000 DF UND 00000000 GLIBC_2.0 strchr" –  Mr Shunz Jul 9 '10 at 15:11

The output from objdump is a little excessive for this purpose, and requires a good bit of parsing to find the actual imports.

I prefer readelf for this purpose:

readelf -d dynamic-buffer-test

Dynamic section at offset 0x630a8 contains 23 entries:
 Tag                Type                 Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]

As you can see, the required libraries are marked with "NEEDED".

share|improve this answer

I prefer readelf.

readelf -s <file>

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.