[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] mathx for Lua 5.3
- From: Tim Hill <drtimhill@...>
- Date: Wed, 6 May 2015 11:51:26 -0700
> On May 6, 2015, at 3:45 AM, Rob Kendrick <email@example.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.
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).