Let us have a quick review of the cases for:
But both options are actually correct, aren't them?
I would like to glance a four square map showing relevant cases, but have not found any at all.
While PIC/non-PIC and dynamic/static linking are independent concepts, there is an "affinity" between PIC and dynamic linking. However, beside a small performance penalty, there is no reason against using PIC in static libraries as well.
Furthermore, also dynamic libraries can be made relocatable. This approach is often done in MIPS systems. For static linking, relocatable code is frequently used anyway.
In addition, in the times of MMUs, the relation of PIC/nonPIC and static/dynamic linking is decoupled, or more precise: PIC becomes less significant.
To summarize: any combination is possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With