[PATCH] Gold: Fix mips.cc for GCC 4.2

H.J. Lu hongjiu.lu@intel.com
Tue May 2 00:09:00 GMT 2017


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.

OK for master?

H.J.
--
	* mips.cc (Mips_relocate_functions): Add "llu" suffix to
	0x800080008000.
---
 gold/mips.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gold/mips.cc b/gold/mips.cc
index 4fc160b..5555562 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -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)
-- 
2.9.3



More information about the Binutils mailing list