共有オブジェクトとは?
共有オブジェクトは、しばしば .so や .dll という拡張子を持つコンパイル済みライブラリで、実行ファイルに組み込まれるのではなく、プログラムの実行時に動的リンカによってロードされます。多くのプロセスが同じ共有オブジェクトをマップでき、そのコードの1つのコピーがすべてに供されます。通常は位置独立コードとしてビルドする必要があります。
なぜ重要か
共有オブジェクトは実行ファイルを小さくし、1つのライブラリの更新が、それを使うすべてのプログラムに恩恵をもたらします。その代償は依存関係の管理であり、実行時に正しいバージョンが存在しなければなりません。
関連ガイド
What Is a Static Library?A static library is an archive of object files whose needed code is copied directly into an executable at lin…
What Is a Dynamic Linker?A dynamic linker loads the shared libraries a program depends on at startup and binds its references to the f…
What Is Position-Independent Code (PIC)?Position-independent code runs correctly regardless of the address it is loaded at, by addressing data and ca…