]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
bb0a1689ed50bc1bb4c8f955c8cce087e253f8ac
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From bcc096a50811bf0f0c4fd34b2993fed7a7015972 Mon Sep 17 00:00:00 2001
2 From: Andy Polyakov <appro@openssl.org>
3 Date: Fri, 3 Nov 2017 23:30:01 +0100
4 Subject: [PATCH] aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with
5 binutils-2.29.
6
7 It's not clear if it's a feature or bug, but binutils-2.29[.1]
8 interprets 'adr' instruction with Thumb2 code reference differently,
9 in a way that affects calculation of addresses of constants' tables.
10
11 Upstream-Status: Backport
12
13 Reviewed-by: Tim Hudson <tjh@openssl.org>
14 Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
15 Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
16 (Merged from https://github.com/openssl/openssl/pull/4669)
17
18 (cherry picked from commit b82acc3c1a7f304c9df31841753a0fa76b5b3cda)
19 ---
20 crypto/aes/asm/aes-armv4.pl | 6 +++---
21 crypto/aes/asm/bsaes-armv7.pl | 6 +++---
22 2 files changed, 6 insertions(+), 6 deletions(-)
23
24 diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
25 index 16d79aae53..c6474b8aad 100644
26 --- a/crypto/aes/asm/aes-armv4.pl
27 +++ b/crypto/aes/asm/aes-armv4.pl
28 @@ -200,7 +200,7 @@ AES_encrypt:
29 #ifndef __thumb2__
30 sub r3,pc,#8 @ AES_encrypt
31 #else
32 - adr r3,AES_encrypt
33 + adr r3,.
34 #endif
35 stmdb sp!,{r1,r4-r12,lr}
36 #ifdef __APPLE__
37 @@ -450,7 +450,7 @@ _armv4_AES_set_encrypt_key:
38 #ifndef __thumb2__
39 sub r3,pc,#8 @ AES_set_encrypt_key
40 #else
41 - adr r3,AES_set_encrypt_key
42 + adr r3,.
43 #endif
44 teq r0,#0
45 #ifdef __thumb2__
46 @@ -976,7 +976,7 @@ AES_decrypt:
47 #ifndef __thumb2__
48 sub r3,pc,#8 @ AES_decrypt
49 #else
50 - adr r3,AES_decrypt
51 + adr r3,.
52 #endif
53 stmdb sp!,{r1,r4-r12,lr}
54 #ifdef __APPLE__
55 diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
56 index 9f288660ef..a27bb4a179 100644
57 --- a/crypto/aes/asm/bsaes-armv7.pl
58 +++ b/crypto/aes/asm/bsaes-armv7.pl
59 @@ -744,7 +744,7 @@ $code.=<<___;
60 .type _bsaes_decrypt8,%function
61 .align 4
62 _bsaes_decrypt8:
63 - adr $const,_bsaes_decrypt8
64 + adr $const,.
65 vldmia $key!, {@XMM[9]} @ round 0 key
66 #ifdef __APPLE__
67 adr $const,.LM0ISR
68 @@ -843,7 +843,7 @@ _bsaes_const:
69 .type _bsaes_encrypt8,%function
70 .align 4
71 _bsaes_encrypt8:
72 - adr $const,_bsaes_encrypt8
73 + adr $const,.
74 vldmia $key!, {@XMM[9]} @ round 0 key
75 #ifdef __APPLE__
76 adr $const,.LM0SR
77 @@ -951,7 +951,7 @@ $code.=<<___;
78 .type _bsaes_key_convert,%function
79 .align 4
80 _bsaes_key_convert:
81 - adr $const,_bsaes_key_convert
82 + adr $const,.
83 vld1.8 {@XMM[7]}, [$inp]! @ load round 0 key
84 #ifdef __APPLE__
85 adr $const,.LM0
86 --
87 2.15.0
88