最終更新:2019-10-06 (日) 13:15:26 (1626d)
ELF/セクションヘッダテーブル
表示
- readelf -S : Display the sections' header
種類
Value Name Meaning 0x0 SHT_NULL? Section header table entry unused 0x1 SHT_PROGBITS Program specific (private) data 0x2 SHT_SYMTAB Symbol table 0x3 SHT_STRTAB String table 0x4 SHT_RELA? Relocation entries with addends 0x5 SHT_HASH? Symbol hash table 0x6 SHT_DYNAMIC? Dynamic linking information 0x7 SHT_NOTE Notes 0x8 SHT_NOBITS Program space with no data (bss) 0x9 SHT_REL? Relocation entries, no addends 0x0A SHT_SHLIB? Reserved 0x0B SHT_DYNSYM Dynamic linker symbol table 0x0E SHT_INIT_ARRAY? Array of constructors 0x0F SHT_FINI_ARRAY? Array of destructors 0x10 SHT_PREINIT_ARRAY? Array of pre-constructors 0x11 SHT_GROUP? Section group 0x12 SHT_SYMTAB_SHNDX? Extended section indices 0x13 SHT_NUM? Number of defined types. 0x60000000 SHT_LOOS? Start OS-specific.
構造体
例
- readelf -S
No Name Type Address Offset Size EntSize? Flags Link Info Align 0 SHT_NULL? 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 1 .interp SHT_PROGBITS 0000000000400238 00000238 000000000000001c 0000000000000000 A 0 0 1 動的リンクを実際に処理するインタプリタ 2 .note.ABI-tag? SHT_NOTE 0000000000400254 00000254 0000000000000020 0000000000000000 A 0 0 4 3 .note.gnu.build-i? SHT_NOTE 0000000000400274 00000274 0000000000000024 0000000000000000 A 0 0 4 4 .gnu.hash? SHT_GNU_HASH? 0000000000400298 00000298 000000000000001c 0000000000000000 A 5 0 8 5 .dynsym SHT_DYNSYM 00000000004002b8 000002b8 0000000000000060 0000000000000018 A 6 1 8 動的シンボルテーブル 6 .dynstr SHT_STRTAB 0000000000400318 00000318 000000000000003d 0000000000000000 A 0 0 1 動的シンボル?の文字列テーブル 7 .gnu.version? SHT_VERSYM? 0000000000400356 00000356 0000000000000008 0000000000000002 A 5 0 2 8 .gnu.version_r? SHT_VERNEED? 0000000000400360 00000360 0000000000000020 0000000000000000 A 6 1 8 9 .rela.dyn? SHT_RELA? 0000000000400380 00000380 0000000000000018 0000000000000018 A 5 0 8 10 .rela.plt SHT_RELA? 0000000000400398 00000398 0000000000000030 0000000000000018 AI 5 24 8 11 .init? SHT_PROGBITS 00000000004003c8 000003c8 000000000000001a 0000000000000000 AX 0 0 4 12 .plt? SHT_PROGBITS 00000000004003f0 000003f0 0000000000000030 0000000000000010 AX 0 0 16 13 .plt.got? SHT_PROGBITS 0000000000400420 00000420 0000000000000008 0000000000000000 AX 0 0 8 14 .text SHT_PROGBITS 0000000000400430 00000430 0000000000000192 0000000000000000 AX 0 0 16 C言語などで書いたプログラムをコンパイルしたコード 15 .fini? SHT_PROGBITS 00000000004005c4 000005c4 0000000000000009 0000000000000000 AX 0 0 4 16 .rodata SHT_PROGBITS 00000000004005d0 000005d0 0000000000000012 0000000000000000 A 0 0 4 17 .eh_frame_hdr? SHT_PROGBITS 00000000004005e4 000005e4 0000000000000034 0000000000000000 A 0 0 4 18 .eh_frame? SHT_PROGBITS 0000000000400618 00000618 00000000000000f4 0000000000000000 A 0 0 8 19 .init_array? SHT_INIT_ARRAY? 0000000000600e10 00000e10 0000000000000008 0000000000000000 WA 0 0 8 20 .fini_array? SHT_FINI_ARRAY? 0000000000600e18 00000e18 0000000000000008 0000000000000000 WA 0 0 8 21 .jcr? SHT_PROGBITS 0000000000600e20 00000e20 0000000000000008 0000000000000000 WA 0 0 8 22 .dynamic SHT_DYNAMIC? 0000000000600e28 00000e28 00000000000001d0 0000000000000010 WA 6 0 8 動的リンクに必要な情報を集めたテーブル 23 .got? SHT_PROGBITS 0000000000600ff8 00000ff8 0000000000000008 0000000000000008 WA 0 0 8 24 .got.plt? SHT_PROGBITS 0000000000601000 00001000 0000000000000028 0000000000000008 WA 0 0 8 25 .data SHT_PROGBITS 0000000000601028 00001028 0000000000000010 0000000000000000 WA 0 0 8 26 .bss SHT_NOBITS 0000000000601038 00001038 0000000000000008 0000000000000000 WA 0 0 1 27 .comment? SHT_PROGBITS 0000000000000000 00001038 0000000000000035 0000000000000001 MS 0 0 1 28 .shstrtab SHT_STRTAB 0000000000000000 000018cc 000000000000010c 0000000000000000 0 0 1 セクション名の文字列テーブル 29 .symtab SHT_SYMTAB 0000000000000000 00001070 0000000000000648 0000000000000018 30 47 8 シンボルテーブル 30 .strtab SHT_STRTAB 0000000000000000 000016b8 0000000000000214 0000000000000000 0 0 1 シンボル名の文字列テーブル
デバッグビルド時
No Name Type Address Offset Size EntSize? Flags Link Info Align 28 .debug_aranges? SHT_PROGBITS 0000000000000000 0000106d 0000000000000030 0000000000000000 0 0 1 29 .debug_info? SHT_PROGBITS 0000000000000000 0000109d 00000000000000be 0000000000000000 0 0 1 30 .debug_abbrev? SHT_PROGBITS 0000000000000000 0000115b 000000000000005e 0000000000000000 0 0 1 31 .debug_line? SHT_PROGBITS 0000000000000000 000011b9 000000000000003c 0000000000000000 0 0 1 32 .debug_str? SHT_PROGBITS 0000000000000000 000011f5 00000000000000c6 0000000000000001 MS 0 0 1 33 .shstrtab SHT_STRTAB 0000000000000000 00001b94 000000000000014c 0000000000000000 0 0 1 34 .symtab SHT_SYMTAB 0000000000000000 000012c0 00000000000006c0 0000000000000018 35 52 8 35 .strtab SHT_STRTAB 0000000000000000 00001980 0000000000000214 0000000000000000 0 0 1