aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@fb.com>2022-05-25 13:30:49 -0700
committerAlexander Yermolovich <ayermolo@fb.com>2022-05-25 13:31:36 -0700
commit256a52d9aac8a9e98fbfd6a3d91090bf127cef7d (patch)
tree14194875710c1eae6bf9556d8c47ee3bf582cce0 /llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
parentb7c8c4d8cf07d2e9e8cd157bccc8bd9e7c76415a (diff)
downloadllvm-256a52d9aac8a9e98fbfd6a3d91090bf127cef7d.zip
llvm-256a52d9aac8a9e98fbfd6a3d91090bf127cef7d.tar.gz
llvm-256a52d9aac8a9e98fbfd6a3d91090bf127cef7d.tar.bz2
Round up zero-sized symbols to 1 byte in `.debug_aranges`.
This commit modifies the AsmPrinter to avoid emitting any zero-sized symbols to the .debug_aranges table, by rounding their size up to 1. Entries with zero length violate the DWARF 5 spec, which states: > Each descriptor is a triple consisting of a segment selector, the beginning > address within that segment of a range of text or data covered by some entry > owned by the corresponding compilation unit, followed by the non-zero length > of that range. In practice, these zero-sized entries produce annoying warnings in lld and cause GNU binutils to truncate the table when parsing it. Other parts of LLVM, such as DWARFDebugARanges in the DebugInfo module (specifically the appendRange method), already avoid emitting zero-sized symbols to .debug_aranges, but not comprehensively in the AsmPrinter. In fact, the AsmPrinter does try to avoid emitting such zero-sized symbols when labels aren't involved, but doesn't when the symbol to emitted is a difference of two labels; this patch extends that logic to handle the case in which the symbol is defined via labels. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D126257
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp')
0 files changed, 0 insertions, 0 deletions