]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix an undefined 32-bit right shift by replacing it with two 16-bit right shifts.
authorNick Clifton <nickc@redhat.com>
Fri, 6 Mar 2015 09:46:15 +0000 (09:46 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 6 Mar 2015 09:46:15 +0000 (09:46 +0000)
PR binutils/17765
* elflink.c (put_value): Like previous delta, but for the 32-bit
case.

bfd/ChangeLog
bfd/elflink.c

index 6810f6b99b3ab75547d9709d00e7f103652762bb..a370597bacb4b9edb1165fd84a4e675e64c59337 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-06  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17765
+       * elflink.c (put_value): Like previous delta, but for the 32-bit
+       case.
+
 2015-03-05  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/17765
index b285e765de7a01893a1a42cab0695781f6890a39..f93293bbeda263a6ec5440cc39b135df37ba4207 100644 (file)
@@ -7807,7 +7807,9 @@ put_value (bfd_vma size,
          break;
        case 4:
          bfd_put_32 (input_bfd, x, location);
-         x >>= 32;
+         /* Computed this way because x >>= 32 is undefined if x is a 32-bit value.  */
+         x >>= 16;
+         x >>= 16;
          break;
 #ifdef BFD64
        case 8: