<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 - Regression in handling 0-length address range entries"
   href="https://bugs.llvm.org/show_bug.cgi?id=46805">46805</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Regression in handling 0-length address range entries
          </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-dwarfdump
          </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>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This regression was introduced in
<a href="https://reviews.llvm.org/rGed9851a0a682d1ff288ed749287fbc7682ed1514">https://reviews.llvm.org/rGed9851a0a682d1ff288ed749287fbc7682ed1514</a> (see
<a href="https://reviews.llvm.org/D71932">https://reviews.llvm.org/D71932</a> for the review).

A .debug_aranges table might contain an entry for a zero-length function or
data. This is not forbidden by the standard, and can happen in practice. In
such a case, it should not be an error. In up to at least LLVM version 9, this
worked fine, but the cited change caused an error to start occurring. Example:

PS C:\Work\TempWork> llvm-dwarfdump.exe --debug-aranges bar.elf
bar.elf:        file format elf64-x86-64

.debug_aranges contents:
error: address range table at offset 0x0 has an invalid tuple (length = 0) at
offset 0x10

A trivial asm input might look like:
foo:

.secton .debug_aranges,"",@progbits
... # Some data for the header
.quad foo
.quad 0 # 0 length
.quad 0 # The .debug_aranges terminator
.quad 0

Note that simply removing the error message is not quite the right fix - we
still want to emit an error if a terminator is detected before the claimed end
of the file, but beware a similar issue to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llvm-dwarfdump cannot handle .debug_ranges/.debug_loc empty relocated range in ET_REL object"
   href="show_bug.cgi?id=46804">bug 46804</a>, where in an ET_REL file,
the address might appear to be zero, but it is relocated.</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>