This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Add unaligned check for R_MIPS_PC16.
- From: Cary Coutant <ccoutant at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 20 Jun 2016 19:17:45 -0000
- Subject: [binutils-gdb] Add unaligned check for R_MIPS_PC16.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=beceef50438ccf2917744147a4fdadcc84db7d78
commit beceef50438ccf2917744147a4fdadcc84db7d78
Author: Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
Date: Mon Jun 20 12:06:56 2016 -0700
Add unaligned check for R_MIPS_PC16.
gold/
* mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
Diff:
---
gold/ChangeLog | 4 ++++
gold/mips.cc | 3 +++
2 files changed, 7 insertions(+)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 6d315c5..cf8289b 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,9 @@
2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
+ * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
+
+2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
+
* mips.cc (relocation_needs_la25_stub): Add support for relocs:
R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
(hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
diff --git a/gold/mips.cc b/gold/mips.cc
index cea0a81..e2b7855 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -4690,6 +4690,9 @@ class Mips_relocate_functions : public Relocate_functions<size, big_endian>
else
elfcpp::Swap<32, big_endian>::writeval(wv, val);
+ if (psymval->value(object, addend) & 3)
+ return This::STATUS_PCREL_UNALIGNED;
+
return check_overflow<18>(x);
}