[PATCH] D71932: [DWARF] Better detect errors in Address Range Tables.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 21 03:07:57 PDT 2020
jhenderson added inline comments.
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp:167-171
+ return createStringError(
+ errc::invalid_argument,
+ "address range table at offset 0x%" PRIx64
+ " has an invalid tuple (length = 0) at offset 0x%" PRIx64,
+ Offset, *offset_ptr - tuple_size);
----------------
@ikudrin, I know this was committed a while back, but I only just ran into this.
Why was this check added? There's nothing in the DWARF spec that I know of that requires a non-zero length for all non-terminating entries. In our Sony linker, prior to the new tombstoning functionality that has recently been implemented, we would patch a reference in the .debug_aranges to have a zero length, and -1 for the address. This used to be fine, but recent versions of llvm-dwarfdump now can't dump this. Even without the Sony changes, there are occasionally functions in the DWARF with zero length (see also my post earlier today on the llvm-dev list for .debug_loc and zero length entry descriptions).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71932/new/
https://reviews.llvm.org/D71932
More information about the llvm-commits
mailing list