<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Allow printing of dynamic symbols even if section header table has been stripped"
   href="https://bugs.llvm.org/show_bug.cgi?id=45089">45089</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Allow printing of dynamic symbols even if section header table has been stripped
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llvm-readobj
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jh7370.2008@my.bristol.ac.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jh7370.2008@my.bristol.ac.uk, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>