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.