commands

readelf — inspect ELF metadata

GNU readelf -d displays the dynamic section, including direct NEEDED library entries where present. Static inspection does not execute the target; isolate untrusted input even for parsing. Use the specified distribution and fresh private workspace; no sudo.

Formal Syntax & Structure

linux syntaxlinux
readelf -d FILE

Parameters & Attributes

NameTypeDescription
-doptiondynamic section
FILEoperandELF file

Return Value

exit status and output

GNU readelf -d displays the dynamic section, including direct NEEDED library entries where present. Static inspection does not execute the target; isolate untrusted input even for parsing.

Working Example

Example Snippetlinux
readelf -d /usr/bin/true | grep '(NEEDED)' >/dev/null && printf 'direct dependencies found\n'
Linux Reference