我想知道在解析ELF文件时,如何区分
它们的描述如下:
在执行
.shstrtab
和.strtab
?从阅读elf(5) - Linux manual page得知,两者都是类型为SHT_STRTAB
的节头,那么我怎么知道我遇到的是哪一个?它们的描述如下:
.shstrtab
This section holds section names. This section is of type
SHT_STRTAB. No attribute types are used.
.strtab
This section holds strings, most commonly the strings that
represent the names associated with symbol table entries. If
the file has a loadable segment that includes the symbol
string table, the section's attributes will include the
SHF_ALLOC bit. Otherwise, the bit will be off. This section
is of type SHT_STRTAB.
在执行
readelf file.o
命令时,我看到了以下内容:...
[18] .strtab STRTAB 0000000000000000 00000548
0000000000000033 0000000000000000 0 0 1
[19] .shstrtab STRTAB 0000000000000000 000007a8
00000000000000a8 0000000000000000 0 0 1
除了偏移量之外,它们在我的眼中看起来是一样的。