https://bugs.llvm.org/show_bug.cgi?id=43991
Bug ID: 43991
Summary: Don't assume that there is only one SHT_SYMTAB_SHNDX
section
Product: tools
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: llvm-readobj
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
llvm-readobj/elf incorrectly assumes taht there is a maximum of one
SHT_SYMTAB_SHNDX section. This section is then used any time the section index
for a symbol needs to be looked up. This is incorrect. The SHT_SYMTAB_SHNDX
sections are paired up with symbol tables via their sh_link fields. In
practice, it's relatively unlikely to see two SHT_SYMTAB_SHNDX sections, but it
matters in the unlikely case of a dynamic object having many sections. In such
a case, there should be two SHT_SYMTAB_SHNDX sections, one for the static
symbol table and the other for the dynamic symbol table, with corresponding
sh_link fields set (the dynamic one is also referenced by the DT_SYMTAB_SHNDX
dynamic tag). Due to their nature, these sections cannot be combined into one.
There are cases in the llvm-readobj code where a dynamic symbol could end up
looking up the section index in the wrong table, so this should be fixed.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs