14.1. Generating Position Independent Code - -fPIC Option¶
Position independent code is a contiguous block of executable code comprised of one or more function definitions and read-only (RO) data objects that are gathered into an RO segment.
Using the -fPIC compiler option instructs the compiler to generate code, as far as possible, independent of what target memory address it is loaded to. In most cases, it is not possible to eliminate all assumptions about the location of the code, and the compiler needs assistance from an external tool to make code fully “position independent”.
The tiarmclang compiler tools employ dynamic linking to facilitate full “position independence”.