This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Gold: Fix mips.cc for GCC 4.2
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Mon, 1 May 2017 17:09:37 -0700
- Subject: [PATCH] Gold: Fix mips.cc for GCC 4.2
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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