From 9c17922bfec7b9a0f6183b996cba5a9699f0da1a Mon Sep 17 00:00:00 2001 From: rupothar Date: Fri, 26 Aug 2022 23:13:06 +0530 Subject: [PATCH] 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. --- bfd/dwarf2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 69d30216771..6e5d40b8241 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; -- 2.30.2