aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorrupothar <rupesh.potharla@amd.com>2022-08-26 23:13:06 +0530
committerAlan Modra <amodra@gmail.com>2022-08-27 14:25:44 +0930
commit9c17922bfec7b9a0f6183b996cba5a9699f0da1a (patch)
tree4853d2f2f392b24593726c93077b8c0908d67920 /bfd/dwarf2.c
parent46e59b72f21029f2a863e3828cec76a03283b49d (diff)
downloadgdb-9c17922bfec7b9a0f6183b996cba5a9699f0da1a.zip
gdb-9c17922bfec7b9a0f6183b996cba5a9699f0da1a.tar.gz
gdb-9c17922bfec7b9a0f6183b996cba5a9699f0da1a.tar.bz2
bfd: Fix minor bug in read_indexed_address function.
read_indexed_address function is using offset_size instead of addr_size while reading addrx forms.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 69d3021..6e5d40b 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1412,7 +1412,7 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
&file->dwarf_addr_buffer, &file->dwarf_addr_size))
return 0;
- if (_bfd_mul_overflow (idx, unit->offset_size, &offset))
+ if (_bfd_mul_overflow (idx, unit->addr_size, &offset))
return 0;
offset += unit->dwarf_addr_offset;
@@ -1423,9 +1423,9 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
info_ptr = file->dwarf_addr_buffer + offset;
- if (unit->offset_size == 4)
+ if (unit->addr_size == 4)
return bfd_get_32 (unit->abfd, info_ptr);
- else if (unit->offset_size == 8)
+ else if (unit->addr_size == 8)
return bfd_get_64 (unit->abfd, info_ptr);
else
return 0;