日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

UNIX 目標文件初探( 五 )


正如從該輸出中看到的,簡單的 a.out Hello World 文件中包含了大量有價值的細節(jié)信息,包括版本信息、柱狀圖、各種符號類型的表格,等等 。通過使用本文中介紹的這幾種工具分析目標文件,您可以慢慢地對可執(zhí)行程序進行研究 。
除了所有這些段之外,編譯器可以將調(diào)試信息放入到目標文件中,并且還可以顯示這些信息 。輸入下面的命令,仔細分析編譯器的輸出(假設(shè)您扮演了調(diào)試程序的角色):
readelf --debug-dump a.out | less
這個命令生成的輸出如清單 5 所示 。調(diào)試工具,如 GDB,可以讀取這些調(diào)試信息,并且當(dāng)程序在調(diào)試器中運行的同時,您可以使用該工具顯示更具描述性的標記,而不是對代碼進行反匯編時的原始地址值 。
清單 5. 該程序中的調(diào)試信息The section .debug_aranges contains:
 Length:28
 Version: 2
 Offset into .debug_info: 0
 Pointer Size: 4
 Segment Size: 0
Address Length
080482c0 34
 Length:52
 Version: 2
 Offset into .debug_info: 10b
 Pointer Size: 4
 Segment Size: 0
Address Length
08048308 4
08048458 18
08048278 11
080482e4 36
 Length:44
 Version: 2
 Offset into .debug_info: 19b
 Pointer Size: 4
 Segment Size: 0
Address Length
08048308 4
0804846f 6
0804828d 2
Contents of the .debug_pubnames section:
 Length: 33
 Version: 2
 Offset into .debug_info section: 122
 Size of area in .debug_info section: 145
Offset Name
121 _IO_stdin_used
The section .debug_info contains:
 Compilation Unit @ offset 0x0:
Length:118
Version:2
Abbrev Offset: 0
Pointer Size: 4
<0>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list: 0
DW_AT_low_pc : 0x80482c0
DW_AT_high_pc : 0x80482e2
DW_AT_name: ../sysdeps/i386/elf/start.S
DW_AT_comp_dir: /build/buildd/glibc-2.3.6/build-tree/glibc-2.3.6/csu
DW_AT_producer: GNU AS 2.16.91
DW_AT_language: 32769 (MIPS assembler)
 Compilation Unit @ offset 0x7a:
Length:141
Version:2
Abbrev Offset: 20
Pointer Size: 4
<0><85>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list: 0x5b
DW_AT_high_pc : 0x80482e4
DW_AT_low_pc : 0x80482e4
DW_AT_producer: (indirect string, offset: 0x62): GNU C 3.4.6
DW_AT_language: 1 (ANSI C)
DW_AT_name: (indirect string, offset: 0x0): init.c
DW_AT_comp_dir: (indirect string, offset: 0x11): /build/buildd/...
<1><9f>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x90): unsigned int
DW_AT_byte_size: 4
DW_AT_encoding: 7 (unsigned)
<1>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x54): unsigned char
DW_AT_byte_size: 1
DW_AT_encoding: 8 (unsigned char)
<1>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x9d): short unsigned int
DW_AT_byte_size: 2
DW_AT_encoding: 7 (unsigned)
<1>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x8b): long unsigned int
DW_AT_byte_size: 4
DW_AT_encoding: 7 (unsigned)
<1>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x56): signed char
DW_AT_byte_size: 1
DW_AT_encoding: 6 (signed char)
<1>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_name: (indirect string, offset: 0x7): short int
DW_AT_byte_size: 2
DW_AT_encoding: 5 (signed)
<1>: Abbrev Number: 3 (DW_TAG_base_type)
DW_AT_name: int
DW_AT_byte_size: 4
DW_AT_encoding: 5 (signed)

推薦閱讀