position-independent code

noun
UK /pəˈzɪʃən ˌɪndɪˈpɛndənt kəʊd/
US /pəˈzɪʃən ˌɪndɪˈpɛndənt koʊd/

Computer code that works no matter where it is placed in memory.

The library was compiled as position-independent code so it could be loaded at any address.


OTHER MEANINGS

2. Machine code that uses relative addressing instead of fixed addresses.

Position-independent code avoids absolute jumps, making it safer for address space layout randomization.

3. A compiler output mode enabled by flags such as -fPIC.

Building with -fPIC produces position-independent code suitable for shared objects.

4. Code designed to run correctly regardless of its load address in a process's virtual memory.

The loader mapped the position-independent code into the process without needing to patch addresses.