Fix location list offset address dump under DW_AT_location (dwarf-5)
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>
Mon, 27 Jun 2022 07:37:55 +0000 (13:07 +0530)
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Mon, 27 Jun 2022 08:04:09 +0000 (13:34 +0530)
commit2d1388e73c700f689b23d53b504e0991fe196596
treebc3d421f06657165aee3c19fcc62b71eadd19870
parent0d8fb090a7d51c79095983e22b097ba1e6eeb17b
Fix location list offset address dump under DW_AT_location (dwarf-5)

For clang compiled objects with dwarf-5, location list offset address dump
under DW_AT_location is corrected, where DW_FORM_loclistx is used. While
dumping the location list offset, the address dumped is wrong where it was
refering to .debug_addr instead of .debug_loclists

      * dwarf.c (fetch_indexed_value): Add base_address as parameter and
      use it to access the section offset.
      (read_and_display_attr_value): Handle DW_FORM_loclistx form separately.
      Pass loclists_base to fetch_indexed_value().
binutils/dwarf.c