title: readelf shows non-empty debug_ranges but it appears empty in llvm
body: <p>I have generated an ELF object via MCJIT with debug information, but when I read it back in LLVM it finds an empty <code>debug_ranges</code> section, even though there should be data there. I've dumped the object file to disk, and indeed:</p>
  
  <pre><code>$ readelf -wR objfile
  Contents of the .debug_ranges section:
  
      Offset   Begin    End
      00000000 0000000000000089 00000000000000b6 
      00000000 0000000000000120 0000000000000150 
      00000000 &lt;End of list&gt;
  
  $ llvm-dwarfdump --debug-dump=ranges objfile
  
  objfile:        file format ELF64-x86-64
  
  
  .debug_ranges contents:
  </code></pre>
  
  <p>Dumping with plain <code>llvm-dwarfdump objfile</code> gives the slightly more detailed:</p>
  
  <pre><code>.debug_ranges contents:
  00000000 &lt;End of list&gt;
  00000010 &lt;End of list&gt;
  00000020 &lt;End of list&gt;
  </code></pre>
  
  <p>So it seems that the data is written successfully but not properly read. Any ideas what can cause this and how can I solve it?</p>
  
  <p>I've generated the object file using LLVM 3.2, and tried <code>llvm-dwarfdump</code> from both 3.2 and top-of-trunk.</p>