We found a similar error as the description in D58698 when dumping the debug info of the SPEC xalancbmk_r with llvm-dwarfdump under DWARF3, ie. the location list overflows the debug_loc section.
Although in DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section offset, but they may actually be size values instead of offsets in some scenarios. The overflow-error occurred when we try to dump the location list for such scenarios.
After narrowing down the cases, we found the error occurs for three attributes, DW_AT_data_member_location, DW_AT_count and DW_AT_byte_size.
DW_FORM_data4 and DW_FORM_data8 are obviously not offsets in DWARF3+, but it’s hard to tell whether they are offsets in DWARF3. In this patch, we are dropping the support of dumping location for DW_AT_data_member_location, DW_AT_count and DW_AT_byte_size if the form is DW_FORM_data4 and DW_FORM_data8.