diff --git a/wolfcrypt/src/aes_gcm_asm.S b/wolfcrypt/src/aes_gcm_asm.S index e878690e8..d844001d7 100644 --- a/wolfcrypt/src/aes_gcm_asm.S +++ b/wolfcrypt/src/aes_gcm_asm.S @@ -8731,3 +8731,7 @@ L_AES_GCM_decrypt_avx2_cmp_tag_done: .size AES_GCM_decrypt_avx2,.-AES_GCM_decrypt_avx2 #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/chacha_asm.S b/wolfcrypt/src/chacha_asm.S index f9d5fff81..729446220 100644 --- a/wolfcrypt/src/chacha_asm.S +++ b/wolfcrypt/src/chacha_asm.S @@ -1418,3 +1418,7 @@ L_chacha20_avx2_end256: .size chacha_encrypt_avx2,.-chacha_encrypt_avx2 #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/fe_x25519_asm.S b/wolfcrypt/src/fe_x25519_asm.S index 6d0f638b5..43ea0d3b5 100644 --- a/wolfcrypt/src/fe_x25519_asm.S +++ b/wolfcrypt/src/fe_x25519_asm.S @@ -16540,3 +16540,7 @@ _fe_ge_sub_avx2: .size fe_ge_sub_avx2,.-fe_ge_sub_avx2 #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/poly1305_asm.S b/wolfcrypt/src/poly1305_asm.S index 95711075b..810dcff2d 100644 --- a/wolfcrypt/src/poly1305_asm.S +++ b/wolfcrypt/src/poly1305_asm.S @@ -1103,3 +1103,7 @@ L_poly1305_avx2_final_cmp_copy: .size poly1305_final_avx2,.-poly1305_final_avx2 #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.S b/wolfcrypt/src/port/arm/armv8-32-curve25519.S index 6fd1ed3f2..1fcf6f869 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.S @@ -23,7 +23,6 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.S */ - #ifdef WOLFSSL_ARMASM #ifndef __aarch64__ .text @@ -6010,3 +6009,7 @@ fe_ge_sub: .size fe_ge_sub,.-fe_ge_sub #endif /* !__aarch64__ */ #endif /* WOLFSSL_ARMASM */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.c b/wolfcrypt/src/port/arm/armv8-32-curve25519.c index f7ef3795c..3cc843929 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.c +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.c @@ -23,19 +23,14 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.c */ - +#ifdef WOLFSSL_ARMASM #ifndef __aarch64__ - #include #ifdef HAVE_CONFIG_H #include -#endif - +#endif /* HAVE_CONFIG_H */ #include - -#ifdef WOLFSSL_ARMASM #include -#include void fe_init() { @@ -5577,5 +5572,5 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz (void)qyminusx; } -#endif /* WOLFSSL_ARMASM */ #endif /* !__aarch64__ */ +#endif /* WOLFSSL_ARMASM */ diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S index d2b899c12..685f87cc7 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S @@ -23,7 +23,6 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S */ - #ifdef WOLFSSL_ARMASM #ifndef __aarch64__ #ifdef WOLFSSL_ARMASM_NO_NEON @@ -5333,3 +5332,7 @@ L_sha512_len_neon_start: #endif /* !WOLFSSL_ARMASM_NO_NEON */ #endif /* !__aarch64__ */ #endif /* WOLFSSL_ARMASM */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c index c502a3997..6786d30b0 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c @@ -23,17 +23,13 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c */ - +#ifdef WOLFSSL_ARMASM #ifndef __aarch64__ #include - #ifdef HAVE_CONFIG_H #include -#endif - +#endif /* HAVE_CONFIG_H */ #include - -#ifdef WOLFSSL_ARMASM #include #ifdef WOLFSSL_ARMASM_NO_NEON @@ -4779,5 +4775,5 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len) } #endif /* !WOLFSSL_ARMASM_NO_NEON */ -#endif /* WOLFSSL_ARMASM */ #endif /* !__aarch64__ */ +#endif /* WOLFSSL_ARMASM */ diff --git a/wolfcrypt/src/port/arm/armv8-curve25519.S b/wolfcrypt/src/port/arm/armv8-curve25519.S index 891c6d815..36be60de5 100644 --- a/wolfcrypt/src/port/arm/armv8-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-curve25519.S @@ -23,6 +23,7 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.S */ +#ifdef WOLFSSL_ARMASM #ifdef __aarch64__ .text .align 2 @@ -6713,3 +6714,8 @@ fe_ge_sub: ret .size fe_ge_sub,.-fe_ge_sub #endif /* __aarch64__ */ +#endif /* WOLFSSL_ARMASM */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/port/arm/armv8-curve25519.c b/wolfcrypt/src/port/arm/armv8-curve25519.c index d1ab4c89c..b84a9d190 100644 --- a/wolfcrypt/src/port/arm/armv8-curve25519.c +++ b/wolfcrypt/src/port/arm/armv8-curve25519.c @@ -23,17 +23,14 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.c */ +#ifdef WOLFSSL_ARMASM #ifdef __aarch64__ #include #ifdef HAVE_CONFIG_H #include -#endif - +#endif /* HAVE_CONFIG_H */ #include - -#ifdef WOLFSSL_ARMASM #include -#include void fe_init() { @@ -6721,5 +6718,5 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz (void)qyminusx; } -#endif /* WOLFSSL_ARMASM */ #endif /* __aarch64__ */ +#endif /* WOLFSSL_ARMASM */ diff --git a/wolfcrypt/src/port/arm/armv8-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-sha512-asm.S index a35bccbda..6ae7a30c4 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-sha512-asm.S @@ -23,6 +23,7 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.S */ +#ifdef WOLFSSL_ARMASM #ifdef __aarch64__ .text .section .rodata @@ -1044,3 +1045,8 @@ L_sha512_len_neon_start: ret .size Transform_Sha512_Len,.-Transform_Sha512_Len #endif /* __aarch64__ */ +#endif /* WOLFSSL_ARMASM */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/port/arm/armv8-sha512-asm.c b/wolfcrypt/src/port/arm/armv8-sha512-asm.c index d323598dd..1ecfa3ebb 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512-asm.c +++ b/wolfcrypt/src/port/arm/armv8-sha512-asm.c @@ -23,16 +23,13 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.c */ +#ifdef WOLFSSL_ARMASM #ifdef __aarch64__ #include - #ifdef HAVE_CONFIG_H #include -#endif - +#endif /* HAVE_CONFIG_H */ #include - -#ifdef WOLFSSL_ARMASM #include static const uint64_t L_SHA512_transform_neon_len_k[] = { @@ -1037,5 +1034,5 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len) ); } -#endif /* WOLFSSL_ARMASM */ #endif /* __aarch64__ */ +#endif /* WOLFSSL_ARMASM */ diff --git a/wolfcrypt/src/sha256_asm.S b/wolfcrypt/src/sha256_asm.S index c433d341c..452f3edb3 100644 --- a/wolfcrypt/src/sha256_asm.S +++ b/wolfcrypt/src/sha256_asm.S @@ -22651,3 +22651,7 @@ L_sha256_len_avx2_rorx_done: .size Transform_Sha256_AVX2_RORX_Len,.-Transform_Sha256_AVX2_RORX_Len #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/sha512_asm.S b/wolfcrypt/src/sha512_asm.S index 6a27ce42a..563d2af8c 100644 --- a/wolfcrypt/src/sha512_asm.S +++ b/wolfcrypt/src/sha512_asm.S @@ -10739,3 +10739,7 @@ L_sha512_len_avx2_rorx_done: .size Transform_Sha512_AVX2_RORX_Len,.-Transform_Sha512_AVX2_RORX_Len #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/wolfcrypt/src/sp_x86_64_asm.S b/wolfcrypt/src/sp_x86_64_asm.S index 58ae2271a..3edc69af3 100644 --- a/wolfcrypt/src/sp_x86_64_asm.S +++ b/wolfcrypt/src/sp_x86_64_asm.S @@ -42865,3 +42865,7 @@ _sp_384_mul_d_avx2_6: #endif /* __APPLE__ */ #endif /* HAVE_INTEL_AVX2 */ #endif /* WOLFSSL_SP_384 */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif