Open d-e-s-o opened 1 year ago
Our string lookup logic is also questionable. See https://github.com/libbpf/blazesym/pull/190#discussion_r1212089043
For reference, over in https://github.com/libbpf/blazesym/pull/384#pullrequestreview-1709204144 the following case was also mentioned:
For extended program header table numbering the scheme is similar, with the e_phnum field of the executable header holding the value PN_XNUM (0xFFFF) and the sh_link field of the zeroth section header table holding the actual number of program header table entries.
We should also check what happens when there are more than 0xffff sections and we try to access one via the Elf64_Sym.st_shndx
member (which is 16 bits in size). See https://github.com/libbpf/blazesym/pull/389#discussion_r1379425619
It appears as if the ELF parser does not handle all possible values of
e_shstrndx
correctly:https://github.com/libbpf/blazesym/blob/master/src/elf/parser.rs#L192-L207
ELF(5)
states:So we may have to special case
SHN_XINDEX
.