DWARFVerifier: Check section-relative references at the end of the section
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 14 Aug 2021 19:46:08 +0000 (12:46 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 15 Aug 2021 18:40:24 +0000 (11:40 -0700)
commit62a4c2c10e8eadd5bab49be72d642db257b46100
tree19ab270f7504d92f642cb7db8ecda890d3ddac0d
parent786b8fcc9b1eed093926e6d9c36891ab72b7bde3
DWARFVerifier: Check section-relative references at the end of the section

This ensures that debug_types references aren't looked for in
debug_info section.

Behavior is still going to be questionable in an unlinked object file -
since cross-cu references could refer to symbols in another .debug_info
(or, in theory, .debug_types) chunk - but if a producer only uses
ref_addr to refer to things within the same .debug_info chunk in an
object file (eg: whole program optimization/LTO - producing two CUs into
a single .debug_info section in an object file - the ref_addrs there
could be resolved relative to that .debug_info chunk, not needing to
consider comdat  (DWARFv5 type units or other creatures) chunks of
.debug_info, etc)
llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
llvm/test/DebugInfo/X86/skeleton-unit-verify.s
llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_ref_addr_between.yaml
llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_ref_multi_section.s [new file with mode: 0644]
llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml