]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Avoid text relocations in iaesx86.s
authorTom Yu <tlyu@mit.edu>
Fri, 10 Jan 2014 20:04:32 +0000 (15:04 -0500)
committerTom Yu <tlyu@mit.edu>
Fri, 10 Jan 2014 20:04:32 +0000 (15:04 -0500)
Use PC-relative addressing to avoid runtime text relocations on i386.

Adapted patch from Nalin Dahyabhai.

ticket: 7815
target_version: 1.12.1
tags: pullup

src/lib/crypto/builtin/aes/iaesx86.s

index 1aa12e6ef05922b2c4c88e5e2c7b75d6fda2c794..33470dd3780b4d53d009891cbaa592b4013efbcd 100644 (file)
@@ -323,7 +323,10 @@ _iEncExpandKey128:
 
         movdqu [edx], xmm1
 
-        movdqa xmm5, [shuffle_mask]
+        call .next
+.next:
+        pop ecx
+        movdqa xmm5, [ecx-.next+shuffle_mask]
 
         add edx,16
 
@@ -421,7 +424,10 @@ _iEncExpandKey256:
 
     add edx,32
 
-    movdqa xmm5, [shuffle_mask]  ; this mask is used by key_expansion
+    call .next
+.next:
+    pop ecx
+    movdqa xmm5, [ecx-.next+shuffle_mask]  ; this mask is used by key_expansion
 
     aeskeygenassist xmm2, xmm3, 0x1     ;
     call key_expansion256