linux/gcc: ldd functionality from inside a C/C++ program

前端 未结 3 1972
南旧
南旧 2020-12-11 05:42

Is there a simple and efficient way to know that a given dynamically linked ELF is missing a required .so for it to run, all from the inside of

3条回答
  •  庸人自扰
    2020-12-11 05:49

    Have you tried dlopen function? you can use this to load a dynamic library (or, for your case, to ckeck if a library can be loaded).

    Having a list of needed libraries is more difficult, take a look to handle_dynamic function on readelf source

提交回复
热议问题