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

Alan Modra amodra@sourceware.org
Tue Feb 21 23:33:00 GMT 2017


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

commit c8dbc58e0a9be82937b5875fe53412e260a6cc42
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  | 5 +++++
 gold/powerpc.cc | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index b9f3c50..0aeff82 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,6 +1,11 @@
 2017-02-22  Alan Modra  <amodra@gmail.com>
 
 	Apply from master
+	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-11  Alan Modra  <amodra@gmail.com>
 	* powerpc.cc (class Powerpc_copy_relocs): New.
 	(Powerpc_copy_relocs::emit): New function.
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 7ff03ea..fec18cd 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;



More information about the Binutils-cvs mailing list