Tell if a shared library was compiled with position independent code

萝らか妹 提交于 2019-12-11 10:23:20

问题


Is there a way to tell whether an OSX shared library (.dylib) was compiled as position independent code/executable?


回答1:


According to this answer you can run otool -hv <file_path> and look for a PIE flag.

Edit: I tested this and it does not work.

Edit 2: Actually it does work on executables. I'm not sure it works on shared libraries.



来源:https://stackoverflow.com/questions/48622448/tell-if-a-shared-library-was-compiled-with-position-independent-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!