Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2014-12-16 Mark Wielaard <mjw@redhat.com>
+
+ * elfcmp.c (compare_Elf32_Word): Make sure (unsigned) Elf32_Word
+ difference doesn't wrap around before returning as int.
+
2014-12-11 Mark Wielaard <mjw@redhat.com>
* readelf.c (print_debug_exception_table): Check TType base offset
{
const Elf32_Word *w1 = p1;
const Elf32_Word *w2 = p2;
- assert (sizeof (int) >= sizeof (*w1));
- return (int) *w1 - (int) *w2;
+ return *w1 < *w2 ? -1 : *w1 > *w2 ? 1 : 0;
}
static int