GHC produces an incorrect DWARF .debug_aranges section in some cases
When parsing the
.debug_aranges section of code produced by GHC (for example using the folly symboliser) the parsing fails because of an incorrect value of the length field.
The bug seems to be here:
initialLength is set to a constant value, while the length should depend on the amount of address range entries in a given section.
It seems to have been introduced in this commit:
where the capability to create a
.debug_aranges section with multiple address ranges was added, but the calculation for
initialLength was not changed.
- GHC version used: 8.4.4