From: Max Filippov Date: Wed, 22 Jul 2020 09:17:38 +0000 (-0700) Subject: bfd: xtensa: pr26246: fix removed_literal_compare X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ad2776d3db6d82cb59cef1495642fc7fcd57ed5;p=binutils-gdb.git bfd: xtensa: pr26246: fix removed_literal_compare 2020-07-22 Max Filippov bfd/ PR 26246 * elf32-xtensa.c (removed_literal_compare): Use correct pointer type for the first function argument. Rename pointers to reflect that they have distinct types. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d6a1d87e5e7..411c19068df 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2020-07-22 Max Filippov + + PR 26246 + * elf32-xtensa.c (removed_literal_compare): Use correct pointer + type for the first function argument. Rename pointers to reflect + that they have distinct types. + 2020-07-20 Alan Modra * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section. diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 45727b3f805..8928b11fbce 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -5989,13 +5989,13 @@ map_removed_literal (removed_literal_list *removed_list) static int removed_literal_compare (const void *a, const void *b) { - const removed_literal_map_entry *pa = a; - const removed_literal_map_entry *pb = b; + const bfd_vma *key = a; + const removed_literal_map_entry *memb = b; - if (pa->addr == pb->addr) + if (*key == memb->addr) return 0; else - return pa->addr < pb->addr ? -1 : 1; + return *key < memb->addr ? -1 : 1; } /* Check if the list of removed literals contains an entry for the