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: unassignedb...@nondot.org
          Reporter: jh7370.2...@my.bristol.ac.uk
                CC: jh7370.2...@my.bristol.ac.uk, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to