This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_25-branch] [GOLD] Fix powerpc overflow check
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 11 Feb 2015 12:50:09 -0000
- Subject: [binutils-gdb/binutils-2_25-branch] [GOLD] Fix powerpc overflow check
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f22bd9263033734769acabb2013008fcea0413e7
commit f22bd9263033734769acabb2013008fcea0413e7
Author: Cary Coutant <ccoutant@google.com>
Date: Mon Dec 22 10:13:37 2014 -0800
[GOLD] Fix powerpc overflow check
* powerpc.cc (Target_powerpc::relocate): Fix overflow check.
Diff:
---
gold/ChangeLog | 6 ++++++
gold/powerpc.cc | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index f10d114..5acec31 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-11 Alan Modra <amodra@gmail.com>
+
+ Apply from master
+ 2014-12-22 Cary Coutant <ccoutant@google.com>
+ * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
+
2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
Cary Coutant <ccoutant@google.com>
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 0450937..d093c9d 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -7452,7 +7452,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
Insn* iview = reinterpret_cast<Insn*>(view - 2 * big_endian);
Insn insn = elfcpp::Swap<32, big_endian>::readval(iview);
- overflow = Reloc::CHECK_SIGNED;
if ((insn & (0x3f << 26)) == 10u << 26 /* cmpli */)
overflow = Reloc::CHECK_BITFIELD;
else if (overflow == Reloc::CHECK_LOW_INSN
@@ -7463,6 +7462,8 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
|| (insn & (0x3f << 26)) == 25u << 26 /* oris */
|| (insn & (0x3f << 26)) == 27u << 26 /* xoris */))
overflow = Reloc::CHECK_UNSIGNED;
+ else
+ overflow = Reloc::CHECK_SIGNED;
}
typename Powerpc_relocate_functions<size, big_endian>::Status status