オブジェクトファイルフォーマット
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2020/11/24 16:01 UTC 版)
「vmlinux」の記事における「オブジェクトファイルフォーマット」の解説
以下は、x86-64アーキテクチャにおけるGentoo Linuxで稼働する、カーネル(バージョン2.6.29)の実行可能イメージからヘッダ情報を抽出したものである(GNU Binutilsパッケージに付属するreadelfコマンドは、ELF定義済みヘッダを出力するコマンドである)。 $ readelf -h vmlinuxELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x1000000 Start of program headers: 64 (bytes into file) Start of section headers: 13951312 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 5 Size of section headers: 64 (bytes) Number of section headers: 45 Section header string table index: 42 ちなみに、同じコマンドをbzImageに実行しても次のようなエラーが返されるだけである。 $ readelf -h arch/x86/boot/bzImagereadelf: Error: Unable to seek to 0xc031f2eb for section headersreadelf: Error: Not an ELF file - it has the wrong magic bytes at the start bzImageは前述の通りELFヘッダを持たないrawバイナリである。
※この「オブジェクトファイルフォーマット」の解説は、「vmlinux」の解説の一部です。
「オブジェクトファイルフォーマット」を含む「vmlinux」の記事については、「vmlinux」の概要を参照ください。
- オブジェクトファイルフォーマットのページへのリンク