summaryrefslogtreecommitdiff
path: root/packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-12-02 20:44:39 (GMT)
committerAlexey Neyman <stilor@att.net>2017-12-02 20:44:39 (GMT)
commit98bc4decdeab1361bdc585c86591718fb08c8ffb (patch)
tree4e048ed57988306696efa3c5b81a80d48030e913 /packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch
parent2a1935f3ad41d360dd3d96a1b0486083293651dd (diff)
Run all patches through renumbering and update
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch')
-rw-r--r--packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch b/packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch
new file mode 100644
index 0000000..0a40611
--- /dev/null
+++ b/packages/binutils/2.25.1/0008-arm-rotate_left-fix.patch
@@ -0,0 +1,21 @@
+From d840c081f8082e8b9e63fead5306643975a97bb3 Mon Sep 17 00:00:00 2001
+From: Richard Earnshaw <Richard.Earnshaw@arm.com>
+Date: Thu, 20 Nov 2014 17:02:47 +0000
+Subject: [PATCH] * config/tc-arm.c (rotate_left): Avoid undefined behaviour
+ when N = 0.
+
+---
+ gas/config/tc-arm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -7261,7 +7261,7 @@
+
+ /* Functions for operand encoding. ARM, then Thumb. */
+
+-#define rotate_left(v, n) (v << n | v >> (32 - n))
++#define rotate_left(v, n) (v << (n & 31) | v >> ((32 - n) & 31))
+
+ /* If VAL can be encoded in the immediate field of an ARM instruction,
+ return the encoded form. Otherwise, return FAIL. */