This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][gold] Mips: Add unaligned check for R_MIPS_PC16.
- From: Vladimir Radosavljevic <Vladimir dot Radosavljevic at imgtec dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: "ccoutant at gmail dot com" <ccoutant at gmail dot com>, Petar Jovanovic <Petar dot Jovanovic at imgtec dot com>
- Date: Mon, 13 Jun 2016 17:01:58 +0000
- Subject: [PATCH][gold] Mips: Add unaligned check for R_MIPS_PC16.
- Authentication-results: sourceware.org; auth=none
This patch adds unaligned check for R_MIPS_PC16.
Depends on https://sourceware.org/ml/binutils/2016-06/msg00180.html.
Regards,
Vladimir
ChangeLog -
gold/
* mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
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);
}