openrisc / or1ksim

The OpenRISC 1000 architectural simulator
GNU General Public License v3.0
69 stars 43 forks source link

Use sh_link in ".symtab" section header to find ".strtab" section header. #12

Closed taoyidong closed 4 years ago

taoyidong commented 7 years ago

Because or1k-elf-gcc(version 5.3.0) will generate the elf section header table like this:

use command or1k-elf-readelf -S

[27] .symtab SYMTAB 00000000 a4ef3c 059860 10 28 11873 4 [28] .strtab STRTAB 00000000 aa879c 061e86 00 0 0 1 [29] .shstrtab STRTAB 00000000 b0a622 000125 00 0 0 1

The last line section head sh_type is STRTAB but not .strtab, the or1ksim will find the wrong .strtab used for .symtab

stffrdhrn commented 4 years ago

Thanks