问题
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