This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_28-branch] Gold: Fix build with GCC 4.2


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=964f1b32b950a906dbd24ee8805d810c07962153

commit 964f1b32b950a906dbd24ee8805d810c07962153
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jan 13 07:46:14 2017 -0800

    Gold: Fix build with GCC 4.2
    
    	PR gold/21040
    	* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
    	Cast 0x80008000 to uint64_t.

Diff:
---
 gold/ChangeLog  | 6 ++++++
 gold/powerpc.cc | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 991d7b8..787fb6e 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR gold/21040
+	* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
+	Cast 0x80008000 to uint64_t.
+
 2017-01-12  Cary Coutant  <ccoutant@gmail.com>
 
 	* object.cc (Sized_relobj_file): Fix byte counts for calls to memmem.
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 3e4e08b..a67c336 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -2010,7 +2010,7 @@ Powerpc_relobj<size, big_endian>::make_toc_relative(
   Address got_base = (target->got_section()->output_section()->address()
 		      + this->toc_base_offset());
   addr -= got_base;
-  if (addr + 0x80008000 >= (uint64_t) 1 << 32)
+  if (addr + (uint64_t) 0x80008000 >= (uint64_t) 1 << 32)
     return false;
 
   *value = addr;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]