其他方面相同的对象文件中的不同节标头偏移



所以我有两个不同的ELF文件,一个是预编译的,另一个是从源代码编译的。readelf的输出为:

预编译文件(文件1(:

ELF Header:
Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class:                             ELF32
Data:                              2's complement, little endian
Version:                           1 (current)
OS/ABI:                            UNIX - System V
ABI Version:                       0
Type:                              REL (Relocatable file)
Machine:                           Texas Instruments TMS320C6000 DSP family
Version:                           0x1
Entry point address:               0x0
Start of program headers:          0 (bytes into file)
Start of section headers:          22752 (bytes into file)
Flags:                             0x0
Size of this header:               52 (bytes)
Size of program headers:           32 (bytes)
Number of program headers:         0
Size of section headers:           40 (bytes)
Number of section headers:         83
Section header string table index: 72
There are 83 section headers, starting at offset 0x58e0:

从源文件编译(文件2(:

ELF Header:
Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class:                             ELF32
Data:                              2's complement, little endian
Version:                           1 (current)
OS/ABI:                            UNIX - System V
ABI Version:                       0
Type:                              REL (Relocatable file)
Machine:                           Texas Instruments TMS320C6000 DSP family
Version:                           0x1
Entry point address:               0x0
Start of program headers:          0 (bytes into file)
Start of section headers:          22920 (bytes into file)
Flags:                             0x0
Size of this header:               52 (bytes)
Size of program headers:           32 (bytes)
Number of program headers:         0
Size of section headers:           40 (bytes)
Number of section headers:         83
Section header string table index: 72
There are 83 section headers, starting at offset 0x5988:

问题:

当其他一切都相同时,是什么原因导致节头偏移从22752到22920的差异?

文件的其余部分完全相同(保存偏移量(,所以我正确地编译了文件。。。但为什么节头偏移会有这种差异?

在其他一切都相同的情况下,是什么导致节头偏移量从22752到22920的差异?

不同的编译器或汇编程序可能会导致这种情况。

文件的其余部分与完全相同

你怎么知道的?

相关内容

  • 没有找到相关文章

最新更新