This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Gold: Fix mips.cc for GCC 4.2
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 26 Jul 2017 17:44:02 -0000
- Subject: [binutils-gdb] Gold: Fix mips.cc for GCC 4.2
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=104f0515d038716599728f8e2b58aefe3fc188aa
commit 104f0515d038716599728f8e2b58aefe3fc188aa
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jul 26 10:39:20 2017 -0700
Gold: Fix mips.cc for GCC 4.2
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.
Diff:
---
gold/ChangeLog | 5 +++++
gold/mips.cc | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 01f0d34..502af85 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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
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)