[llvm-bugs] [Bug 43991] New: Don't assume that there is only one SHT_SYMTAB_SHNDX section

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 13 08:04:55 PST 2019


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: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: jh7370.2008 at my.bristol.ac.uk, llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191113/f7f23680/attachment.html>


More information about the llvm-bugs mailing list