From: Alan Modra Date: Wed, 2 Sep 2020 00:35:52 +0000 (+0930) Subject: ubsan: objdump.c:3009 negation of -2147483648 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=839f41a323fe2ba58e64431bd567a214f776aa7c;p=binutils-gdb.git ubsan: objdump.c:3009 negation of -2147483648 * objdump.c (disassemble_bytes): Use an unsigned type for "addend". --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9872504871b..96701b3a9a3 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2020-09-02 Alan Modra + + * objdump.c (disassemble_bytes): Use an unsigned type for "addend". + 2020-08-30 Alan Modra * readelf.c (print_gnu_build_attribute_name): Use unsigned long diff --git a/binutils/objdump.c b/binutils/objdump.c index c7ad51e41eb..91da48095f3 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -3002,8 +3002,8 @@ disassemble_bytes (struct disassemble_info * inf, if (q->addend) { - bfd_signed_vma addend = q->addend; - if (addend < 0) + bfd_vma addend = q->addend; + if ((bfd_signed_vma) addend < 0) { printf ("-0x"); addend = -addend;