[lldb-dev] finding the symbol dependencies of a bundle, like dyldinfo -lazy_bind -export

Jason E. Aten j.e.aten at gmail.com
Sat Mar 31 23:02:50 PDT 2012

Dear LLDB enthusiasts,

I'm wondering if I can use the lldb library/libraries to replace the
certain code running on OSX that now returns two lists of symbols-- similar
to the output of (dyldinfo -lazy_bind -exports <bundlefile>); i.e. I need
to list the symbols imported and exported by a binary shared object or

My hope was that by using an lldb library, I would be able to use the same
client code on OSX as on linux. (The linux version of the code currently
uses libbfd and libdld to do the same thing, but the later is getting
little love/maintenance).

I'm looking through include/lldb/, as it seems like lldb would need this
same info (imported symbol list, and exported symbol list for a Mach-O
file) to function, but it's not clear which API to use.  All
suggestions/pointers to example code in lldb would be welcome!

Thank you.

# In case it is unclear what dyldinfo does, here is an example: (but I only
need the symbol names; not the addresses or segments or sections):

$ file /tmp/sample_bundle
/tmp/sample_bundle: Mach-O 64-bit bundle x86_64

$dyldinfo -lazy_bind -export /tmp/sample_bundle

lazy binding information (from lazy_bind part of dyld info):
segment section          address    index  dylib            symbol
__DATA  __la_symbol_ptr  0x00001030 0x0000 flat-namespace   __mm_pop_chunk
__DATA  __la_symbol_ptr  0x00001038 0x0015 flat-namespace   _dh_define
export information (from trie):
0x000008A0  _C_ipair
0x00000920  _init_ipair
0x00000BC0  _C_iprot
0x00000C40  _C_ipi2
0x00000CC0  _C_ipi1
0x00001040  _K_ipair_R43808f40
0x00001160  _K_ipi1_R5cb4475d
0x00001260  _K_ipi2_R5cb4475d
0x00001360  _K_iprot_Rfc8fe739
0x00001460  _majver_ipair
0x00001464  _minver_ipair
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20120331/5b21f0a8/attachment.html>

More information about the lldb-dev mailing list