It's readelf, but it will only list libs which are declared in the ELF of the executable. It won't list libraries loaded at startup with dlopen(3), unlike ldd. I'm also not sure, if this script will recurse, but I suspect not. ldd will print libraries loaded recursively.
> It won't list libraries loaded at startup with dlopen(3)
Well, that'd require actually executing the startup code.
Update: Here seems to be one example: https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3...