lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On May 6, 2015, at 3:45 AM, Rob Kendrick <rjek@rjek.com> wrote:
> 
> 
> A shared library needs to be position independent code, that much is
> non-negotiable, but some tooling probably handles it for you.  It
> should always be safe to add.
> 
> B.
> 

Not true at all. Shared libraries have existed for decades and most are NOT pic (Windows NT DLLs for example). Most loadable binary formats have fixup tables of some form that allow the loader to statically relocate the code/data at LOAD time. That’s not pic .. pic involves computing at RUN time addresses that are relative to the current location of the code, which allows it to be relocated on-the-fly. The main reason for using pic is to allow page-sharing across processes when shared libraries are loaded at different locations (typically to prevent various code exploits by malicious code).

—Tim