Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PIC code would work where PIE does, but likely perform worse. In shared libraries, calls to any non-static function can't be assumed to be the same function at runtime, since another library linked or using LD_PRELOAD may also define the symbol. Thus all calls to non-static functions must go through the shared library lookup machinery. This prevents inlining opportunites as well. Functions in an executable can't be overwridden in this manner, and override the symbols in shared libraries. Thus PIE code can have cheaper function calls and freely inline functions.

Its not that you couldn't use the PIC code, but it would be better to just recompile with PIE.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: