I have generated an ELF object via MCJIT with debug information, but when I read it back in LLVM it finds an empty debug_ranges
section, even though there should be data there. I've dumped the object file to disk, and indeed:
$ readelf -wR objfile
Contents of the .debug_ranges section:
Offset Begin End
00000000 0000000000000089 00000000000000b6
00000000 0000000000000120 0000000000000150
00000000 <End of list>
$ llvm-dwarfdump --debug-dump=ranges objfile
objfile: file format ELF64-x86-64
.debug_ranges contents:
Dumping with plain llvm-dwarfdump objfile
gives the slightly more detailed:
.debug_ranges contents:
00000000 <End of list>
00000010 <End of list>
00000020 <End of list>
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?
I've generated the object file using LLVM 3.2, and tried llvm-dwarfdump
from both 3.2 and top-of-trunk.