Move data in AMD64 assembly to text section
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 13 May 2017 15:53:08 +0000 (18:53 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 18 May 2017 17:10:19 +0000 (20:10 +0300)
* cipher/camellia-aesni-avx-amd64.S: Move data to .text section to
ensure that RIP relative addressing of data will work.
* cipher/camellia-aesni-avx2-amd64.S: Ditto.
* cipher/chacha20-avx2-amd64.S: Ditto.
* cipher/chacha20-ssse3-amd64.S: Ditto.
* cipher/des-amd64.S: Ditto.
* cipher/serpent-avx2-amd64.S: Ditto.
* cipher/sha1-avx-amd64.S: Ditto.
* cipher/sha1-avx-bmi2-amd64.S: Ditto.
* cipher/sha1-ssse3-amd64.S: Ditto.
* cipher/sha256-avx-amd64.S: Ditto.
* cipher/sha256-avx2-bmi2-amd64.S: Ditto.
* cipher/sha256-ssse3-amd64.S: Ditto.
* cipher/sha512-avx-amd64.S: Ditto.
* cipher/sha512-avx2-bmi2-amd64.S: Ditto.
* cipher/sha512-ssse3-amd64.S: Ditto.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
15 files changed:
cipher/camellia-aesni-avx-amd64.S
cipher/camellia-aesni-avx2-amd64.S
cipher/chacha20-avx2-amd64.S
cipher/chacha20-ssse3-amd64.S
cipher/des-amd64.S
cipher/serpent-avx2-amd64.S
cipher/sha1-avx-amd64.S
cipher/sha1-avx-bmi2-amd64.S
cipher/sha1-ssse3-amd64.S
cipher/sha256-avx-amd64.S
cipher/sha256-avx2-bmi2-amd64.S
cipher/sha256-ssse3-amd64.S
cipher/sha512-avx-amd64.S
cipher/sha512-avx2-bmi2-amd64.S
cipher/sha512-ssse3-amd64.S

index 5a3a3cb..8022934 100644 (file)
        vmovdqu y6, 14 * 16(rio); \
        vmovdqu y7, 15 * 16(rio);
 
-.data
+.text
 .align 16
 
 #define SHUFB_BYTES(idx) \
 .L0f0f0f0f:
        .long 0x0f0f0f0f
 
-.text
 
 .align 8
 ELF(.type   __camellia_enc_blk16,@function;)
@@ -1702,7 +1701,6 @@ ELF(.size _gcry_camellia_aesni_avx_ocb_auth,.-_gcry_camellia_aesni_avx_ocb_auth;
        vpsllq $(64-(nror)), out, out; \
        vpaddd t0, out, out;
 
-.data
 
 .align 16
 .Linv_shift_row_and_unpcklbw:
@@ -1735,7 +1733,6 @@ ELF(.size _gcry_camellia_aesni_avx_ocb_auth,.-_gcry_camellia_aesni_avx_ocb_auth;
 .Lsigma6:
        .long 0xB3E6C1FD, 0xB05688C2;
 
-.text
 
 .align 8
 ELF(.type  __camellia_avx_setup128,@function;)
index 26381df..897e4ae 100644 (file)
        vmovdqu y6, 14 * 32(rio); \
        vmovdqu y7, 15 * 32(rio);
 
-.data
+.text
 .align 32
 
 #define SHUFB_BYTES(idx) \
 .L0f0f0f0f:
        .long 0x0f0f0f0f
 
-.text
 
 .align 8
 ELF(.type   __camellia_enc_blk32,@function;)
index 12bed35..8c085ba 100644 (file)
@@ -947,7 +947,6 @@ _gcry_chacha20_amd64_avx2_blocks:
        ret
 ELF(.size _gcry_chacha20_amd64_avx2_blocks,.-_gcry_chacha20_amd64_avx2_blocks;)
 
-.data
 .align 16
 .LC:
 .byte 2,3,0,1,6,7,4,5,10,11,8,9,14,15,12,13       /* pshufb rotate by 16 */
index a1a843f..c04010e 100644 (file)
@@ -623,7 +623,6 @@ _gcry_chacha20_amd64_ssse3_blocks:
        ret
 ELF(.size _gcry_chacha20_amd64_ssse3_blocks,.-_gcry_chacha20_amd64_ssse3_blocks;)
 
-.data
 .align 16;
 .LC:
 .byte 2,3,0,1,6,7,4,5,10,11,8,9,14,15,12,13       /* pshufb rotate by 16 */
index 307d211..1b7cfba 100644 (file)
@@ -766,7 +766,6 @@ _gcry_3des_amd64_cfb_dec:
        ret;
 ELF(.size _gcry_3des_amd64_cfb_dec,.-_gcry_3des_amd64_cfb_dec;)
 
-.data
 .align 16
 .L_s1:
        .quad 0x0010100001010400, 0x0000000000000000
index 2902dab..8d60a15 100644 (file)
@@ -1113,7 +1113,6 @@ _gcry_serpent_avx2_ocb_auth:
        ret;
 ELF(.size _gcry_serpent_avx2_ocb_auth,.-_gcry_serpent_avx2_ocb_auth;)
 
-.data
 .align 16
 
 /* For CTR-mode IV byteswap */
index 3b3a6d1..b14603b 100644 (file)
@@ -58,7 +58,7 @@
 
 /* Constants */
 
-.data
+.text
 #define K1  0x5A827999
 #define K2  0x6ED9EBA1
 #define K3  0x8F1BBCDC
  * _gcry_sha1_transform_amd64_avx (void *ctx, const unsigned char *data,
  *                                  size_t nblks)
  */
-.text
 .globl _gcry_sha1_transform_amd64_avx
 ELF(.type _gcry_sha1_transform_amd64_avx,@function)
 .align 16
index 22bcbb3..b267693 100644 (file)
@@ -59,7 +59,7 @@
 
 /* Constants */
 
-.data
+.text
 #define K1  0x5A827999
 #define K2  0x6ED9EBA1
 #define K3  0x8F1BBCDC
  * _gcry_sha1_transform_amd64_avx_bmi2 (void *ctx, const unsigned char *data,
  *                                      size_t nblks)
  */
-.text
 .globl _gcry_sha1_transform_amd64_avx_bmi2
 ELF(.type _gcry_sha1_transform_amd64_avx_bmi2,@function)
 .align 16
index 98a19e6..2b43947 100644 (file)
@@ -58,7 +58,7 @@
 
 /* Constants */
 
-.data
+.text
 #define K1  0x5A827999
 #define K2  0x6ED9EBA1
 #define K3  0x8F1BBCDC
  * _gcry_sha1_transform_amd64_ssse3 (void *ctx, const unsigned char *data,
  *                                   size_t nblks)
  */
-.text
 .globl _gcry_sha1_transform_amd64_ssse3
 ELF(.type _gcry_sha1_transform_amd64_ssse3,@function)
 .align 16
index 8bf26bd..6953855 100644 (file)
@@ -496,7 +496,6 @@ _gcry_sha256_transform_amd64_avx:
        ret
 
 
-.data
 .align 16
 .LK256:
        .long   0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
index 74b6063..85e663f 100644 (file)
@@ -763,7 +763,6 @@ _gcry_sha256_transform_amd64_avx2:
 
        ret
 
-.data
 .align 64
 .LK256:
        .long   0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
index 9ec87e4..a9213e4 100644 (file)
@@ -516,7 +516,6 @@ _gcry_sha256_transform_amd64_ssse3:
        ret
 
 
-.data
 .align 16
 .LK256:
        .long   0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
index 699c271..446a8b4 100644 (file)
@@ -368,8 +368,6 @@ _gcry_sha512_transform_amd64_avx:
 ;;; Binary Data
 */
 
-.data
-
 .align 16
 
 /* Mask for byte-swapping a couple of qwords in an XMM register using (v)pshufb. */
index 02f95af..05bef64 100644 (file)
@@ -735,8 +735,6 @@ _gcry_sha512_transform_amd64_avx2:
 /*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; */
 /*;; Binary Data */
 
-.data
-
 .align 64
 /* K[t] used in SHA512 hashing */
 .LK512:
index c721bcf..51193b3 100644 (file)
@@ -373,8 +373,6 @@ _gcry_sha512_transform_amd64_ssse3:
 ;;; Binary Data
 */
 
-.data
-
 .align 16
 
 /* Mask for byte-swapping a couple of qwords in an XMM register using (v)pshufb. */