[v2,3/6] Cast to bfd_vma in arm-tdep.c
Commit Message
Some arm-tdep.c data structures use a bfd_vma. A couple of spots will
warn about an implicit narrowing cast when building a gdb where
CORE_ADDR is 64-bit but bfd_vma is 32-bit.
This patch silences these warnings by introducing an explicit cast.
This seemed both simplest and correct.
2020-02-25 Tom Tromey <tom@tromey.com>
* arm-tdep.c (map_key, arm_find_exidx_entry): Cast to bfd_vma.
---
gdb/ChangeLog | 4 ++++
gdb/arm-tdep.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
@@ -366,7 +366,7 @@ arm_find_mapping_symbol (CORE_ADDR memaddr, CORE_ADDR *start)
}
struct arm_mapping_symbol map_key
- = { memaddr - obj_section_addr (sec), 0 };
+ = { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 };
arm_mapping_symbol_vec::const_iterator it
= std::lower_bound (map.begin (), map.end (), map_key);
@@ -2246,7 +2246,8 @@ arm_find_exidx_entry (CORE_ADDR memaddr, CORE_ADDR *start)
if (sec != NULL)
{
struct arm_exidx_data *data;
- struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 };
+ struct arm_exidx_entry map_key
+ = { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 };
data = arm_exidx_data_key.get (sec->objfile->obfd);
if (data != NULL)