Gold: Fix mips.cc for GCC 4.2
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Jul 2017 17:39:20 +0000 (10:39 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Jul 2017 17:43:36 +0000 (10:43 -0700)
GCC 4.2 fails to compile "(uint64_t) 0x800080008000" with

error: integer constant is too large for ‘long’ type

This patch adds "llu" suffix to 0x800080008000 for GCC 4.2.

* mips.cc (Mips_relocate_functions): Add "llu" suffix to
0x800080008000.

gold/ChangeLog
gold/mips.cc

index 01f0d34d1c756869a81afccd438e41e27e4a5ab1..502af851c55d7d25b3a4f79ca96e461aeb9629e6 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * mips.cc (Mips_relocate_functions): Add "llu" suffix to
+       0x800080008000.
+
 2017-07-23  Alan Modra  <amodra@gmail.com>
 
        * powerpc.cc (glink_eh_frame_fde_64v2): Correct advance to
index 4fc160bbe9bdd7d16622bbf58c3c92e0b05ac4bf..55555625709a254115bd8a79709dff6db187ad66 100644 (file)
@@ -5664,7 +5664,7 @@ class Mips_relocate_functions : public Relocate_functions<size, big_endian>
                                      : addend_a);
 
     Valtype x = psymval->value(object, addend);
-    x = ((x + (uint64_t) 0x800080008000) >> 48) & 0xffff;
+    x = ((x + (uint64_t) 0x800080008000llu) >> 48) & 0xffff;
     val = Bits<32>::bit_select32(val, x, 0xffff);
 
     if (calculate_only)
This page took 0.029143 seconds and 4 git commands to generate.