<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 - llvm-readelf does not print section types if unknown"
   href="https://bugs.llvm.org/show_bug.cgi?id=40773">40773</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-readelf does not print section types if unknown
          </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>normal
          </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>If llvm-readelf encounters a section type it does not recognise, rather than
printing something along the lines of "unknown" or listing the value as hex, it
leaves the space in the section header dump blank. This is not great at all,
and could break parsers too.

GNU readelf's behaviour is sensible, but varies depending on the exact value.
For values less than SHT_LOOS, the unknown tpye is printed something like this:
"00001000: <unkn"

For values in the OS/Processor/User ranges, it prints it in the form
LOOS/PROC/USER+X e.g:
LOOS+0 (for 0x60000000)
LOUSER+0x7fffff (for 0xffffffff)

We should do something sensible. Options include printing "Unknown (0x123456)"
like llvm-readobj, simply printing "0x123456" or matching GNU's behaviour. I
favour the latter, to make the output as close as possible to GNU's (though I
might suggest "00001000: <unknown>" for values lower than LOOS).</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>