ubsan: objdump.c:3009 negation of -2147483648
authorAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 00:35:52 +0000 (10:05 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 07:00:42 +0000 (16:30 +0930)
* objdump.c (disassemble_bytes): Use an unsigned type for "addend".

binutils/ChangeLog
binutils/objdump.c

index 9872504871bd73dab3edd24b256190291c5dba96..96701b3a9a39f8e33acdb4b2bbd7d0a3f715407a 100644 (file)
@@ -1,3 +1,7 @@
+2020-09-02  Alan Modra  <amodra@gmail.com>
+
+       * objdump.c (disassemble_bytes): Use an unsigned type for "addend".
+
 2020-08-30  Alan Modra  <amodra@gmail.com>
 
        * readelf.c (print_gnu_build_attribute_name): Use unsigned long
index c7ad51e41eba8981f236c6f605c7185cf77167a2..91da48095f37b116ec589223ff36e9789c6ab03b 100644 (file)
@@ -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;