* config/tc-ppc.c (md_assemble): Trim @ha constant to 16 bits, to
authorIan Lance Taylor <ian@airs.com>
Tue, 17 Aug 1999 18:26:49 +0000 (18:26 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 17 Aug 1999 18:26:49 +0000 (18:26 +0000)
handle 0xffffNNNN constants correctly.

gas/ChangeLog
gas/config/tc-ppc.c

index c47013a..1f6b8ff 100644 (file)
@@ -1,3 +1,8 @@
+1999-08-17  Ian Lance Taylor  <ian@zembu.com>
+
+       * config/tc-ppc.c (md_assemble): Trim @ha constant to 16 bits, to
+       handle 0xffffNNNN constants correctly.
+
 1999-08-16  Nick Clifton  <nickc@cygnus.com>
 
        * config/tc-arm.c (do_ldst): Look for register conflicts on stores
index 56c2a48..c18a274 100644 (file)
@@ -1885,8 +1885,9 @@ md_assemble (str)
                break;
 
              case BFD_RELOC_HI16_S:
-               ex.X_add_number = (((ex.X_add_number >> 16) & 0xffff)
-                                  + ((ex.X_add_number >> 15) & 1));
+               ex.X_add_number = ((((ex.X_add_number >> 16) & 0xffff)
+                                   + ((ex.X_add_number >> 15) & 1))
+                                  & 0xffff);
                break;
              }
 #endif