Skip to content

Instantly share code, notes, and snippets.

View toojays's full-sized avatar

John Steele Scott toojays

  • Adelaide, Australia
View GitHub Profile
@toojays
toojays / solib-deps.sh
Created July 15, 2016 04:09
Given a shared library (or executable) print the symbols it uses from libraries it directly depends on.
#!/bin/bash
set -e
# Given a shared library, print the symbols it uses from other libraries it
# directly depends on.
LIB=$1
# Use readelf rather than ldd here to only get direct dependencies.
DEPS=$(readelf -d $LIB | awk '/Shared library:/{ print substr($5, 2, length($5) - 2) }')