现在我们接着上次的步骤分析可执行文件 largest,看看链接器都做了什么改动。
[test@localhost Assembler]$ readelf -a largest
ELF 头:
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 (可执行文件)
Machine: Advanced Micro Devices X86-64
Version: 0x1
入口点地址: 0x4000b0
程序头起点: 64 (bytes into file)
Start of section headers: 664 (bytes into file)
标志: 0x0
本头的大小: 64 (字节)
程序头大小: 56 (字节)
Number of program headers: 2
节头大小: 64 (字节)
节头数量: 6
字符串表索引节头: 3
节头:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .text PROGBITS 00000000004000b0 000000b0
000000000000002d 0000000000000000 AX 0 0 1
[ 2] .data PROGBITS 00000000006000dd 000000dd
0000000000000038 0000000000000000 WA 0 0 1
[ 3] .shstrtab STRTAB 0000000000000000 00000115
0000000000000027 0000000000000000 0 0 1
[ 4] .symtab SYMTAB 0000000000000000 00000140
0000000000000108 0000000000000018