https://bugs.llvm.org/show_bug.cgi?id=46805

            Bug ID: 46805
           Summary: Regression in handling 0-length address range entries
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-dwarfdump
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

This regression was introduced in
https://reviews.llvm.org/rGed9851a0a682d1ff288ed749287fbc7682ed1514 (see
https://reviews.llvm.org/D71932 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 bug 46804, where in an ET_REL file,
the address might appear to be zero, but it is relocated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to