位置独立コード
(position-independent code から転送)
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2020/06/20 15:56 UTC 版)
位置独立コード(いちどくりつコード、英: position-independent code、PIC)または位置独立実行形式(いちどくりつじっこうけいしき、英: position-independent executable、PIE)とは、主記憶装置内のどこに置かれても絶対アドレスに関わらず正しく実行できる機械語の列である。PICは主に共有ライブラリに使われ、各プログラムが(例えば他の共有ライブラリに)使われていない任意の別々のアドレスに同じ共有ライブラリをロードして使うことができる。PICはMMUによる仮想記憶の仕組みが無い古いコンピュータシステムでも使われていた[1]。PICを使えば、MMUのないシステムであってもオペレーティングシステム (OS) が単一のアドレス空間内で複数のアプリケーションを共存させることができる。
- ^ John R. Levine (October 1999). “Chapter 8: Loading and overlays”. Linkers and Loaders. San Francisco: Morgan-Kauffman. pp. 170–171. ISBN 1-55860-496-0
- ^ Alexander Gabert (2004年1月). “Position Independent Code internals”. Hardened Gentoo. 2009年12月3日閲覧。 “direct non-PIC-aware addressing is always cheaper (read: faster) than PIC addressing.”
- ^ Rick Anderson (2000年1月). “The End of DLL Hell”. Microsoft Developer Network. 2007年4月19日時点のオリジナル[リンク切れ]よりアーカイブ。2007年4月26日閲覧。 “Sharing common DLLs does provide a significant savings on memory load. But Windows is not always able to share one instance of a DLL that is loaded by multiple processes.”
- ^ Matt Pietrek (2002年2月). “An In-Depth Look into the Win32 Portable Executable File Format”. MSDN Magazine. 2012年1月28日閲覧。 “PE files can load just about anywhere in the process address space. While they do have a preferred load address, you can't rely on the executable file actually loading there. To avoid having hardcoded memory addresses in PE files, RVAs are used. An RVA is simply an offset in memory, relative to where the PE file was loaded.”
- ^ Matt Pietrek (2000年12月). “MSDN Magazine - Under the Hood - Programming for 64-bit Windows”. 2011年2月9日閲覧。 “Position-independent code eliminates the need for the base relocations that are used in the x86 version of Windows.”
- 1 位置独立コードとは
- 2 位置独立コードの概要
- 3 Windows のDLL
- 4 位置独立実行形式
- 位置独立コードのページへのリンク