readelf display of 0x800...000 addend
authorAlan Modra <amodra@gmail.com>
Wed, 22 Jul 2015 00:56:29 +0000 (10:26 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 22 Jul 2015 15:15:54 +0000 (00:45 +0930)
* readelf.c (dump_relocations): Show MIN_INT addends as negative.

binutils/ChangeLog
binutils/readelf.c

index c1314ccb046f9b1c51372ebd559e920123da31f4..2b1f8c4f3c458fa23d92b71841d20087cef99213 100644 (file)
@@ -1,3 +1,7 @@
+2015-07-22  Alan Modra  <amodra@gmail.com>
+
+       * readelf.c (dump_relocations): Show MIN_INT addends as negative.
+
 2015-07-20  Alan Modra  <amodra@gmail.com>
 
        * doc/Makefile.in: Regenerate.
index c313db4bc21c47966d642742df1be34b5adaf071..a9b9f2dbbd2023ab6d58473a95643597503cc705 100644 (file)
@@ -1608,12 +1608,9 @@ dump_relocations (FILE * file,
 
              if (is_rela)
                {
-                 bfd_signed_vma off = rels[i].r_addend;
+                 bfd_vma off = rels[i].r_addend;
 
-                 /* PR 17531: file: 2e63226f.  */
-                 if (off == ((bfd_signed_vma) 1) << ((sizeof (bfd_signed_vma) * 8) - 1))
-                   printf (" + %" BFD_VMA_FMT "x", off);
-                 else if (off < 0)
+                 if ((bfd_signed_vma) off < 0)
                    printf (" - %" BFD_VMA_FMT "x", - off);
                  else
                    printf (" + %" BFD_VMA_FMT "x", off);
@@ -1622,13 +1619,10 @@ dump_relocations (FILE * file,
        }
       else if (is_rela)
        {
-         bfd_signed_vma off = rels[i].r_addend;
+         bfd_vma off = rels[i].r_addend;
 
          printf ("%*c", is_32bit_elf ? 12 : 20, ' ');
-         /* PR 17531: file: 2e63226f.  */
-         if (off == ((bfd_signed_vma) 1) << ((sizeof (bfd_signed_vma) * 8) - 1))
-           printf ("%" BFD_VMA_FMT "x", off);
-         else if (off < 0)
+         if ((bfd_signed_vma) off < 0)
            printf ("-%" BFD_VMA_FMT "x", - off);
          else
            printf ("%" BFD_VMA_FMT "x", off);