[llvm-bugs] [Bug 45089] New: Allow printing of dynamic symbols even if section header table has been stripped

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 3 08:28:52 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=45089

            Bug ID: 45089
           Summary: Allow printing of dynamic symbols even if section
                    header table has been stripped
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          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-objcopy and llvm-strip provide the --strip-sections option to strip the
section headers. Currently, if llvm-readobj attempts to dump the dynamic
symbols of an ELF stripped in this way, it will print an empty array, as it
does not know the size of the dynamic symbol table (although it does know its
address from the DT_SYMTAB tag).

I believe that it is posssible to derive the dynamic symbol table size from the
hash table (GNU or sysv). For objects with a sysv .hash section, the number of
dynamic symbols should equal the nchain value in the hash table header. For GNU
hash tables, it is a little more complex, but still possible - iterate over all
the buckets and all the chains in those buckets, total the length of all those
chains, and then add the symndx value from the header.

-- 
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/20200303/82eea829/attachment.html>


More information about the llvm-bugs mailing list