Dynamic Shared Object(Library) in Linux - 리눅스 동적 공유 라이브러리
리눅스에서 동적 공유 라이브러리(Dynamic Shared Library)를 사용해 보자.
-fPIC
If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table. This option makes a difference on the m68k, PowerPC and SPARC .
Position-independent code requires special support and therefore works only on certain machines.
-shared
Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this option. For predictable results, you must also specify the same set of options that were used to generate code (-fpic, -fPIC, or model suboptions) when you specify this option.