Getting a list of used libraries by a running process (unix)

后端 未结 7 465
梦如初夏
梦如初夏 2020-12-23 20:30

I need to find out what libraries a unix process has loaded and might use throughout it\'s lifetime. Is this possible and how. Or better yet, i have a library name and i nee

相关标签:
7条回答
  • 2020-12-23 21:15

    I do not have the specific answer that you are looking for, but I have something close, that will perhaps get you close to what you want. You can display the linked library of a specific binary (not process) by:

    1. install xcode https://developer.apple.com/xcode/
    2. execute: otool -L PATH_TO_BINARY

    EXAMPLE:

    chris$ otool -L /usr/local/bin/mtr
    mtr:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 46.1.0)
    
    0 讨论(0)
提交回复
热议问题