Move no-exec-stack sections outside of #ifs. When building with |OPENSSL_NO_ASM|, the section that marks assembly files as no-exec-stack will currently be omitted. That results in an empty assembly file but that's still enough to trigger warnings: warning: crypto_tests/trampoline-x86_64.o: missing .note.GNU-stack section implies executable stack This change makes it so that the section marker will always be emitted, even if the file is otherwise empty. Change-Id: I2d08d34ed9dbe9e9592c88dcd42d3ba4fa3d7652 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/38084 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/curve25519/asm/x25519-asm-arm.S b/crypto/curve25519/asm/x25519-asm-arm.S index 9a26add..41bc0c6 100644 --- a/crypto/curve25519/asm/x25519-asm-arm.S +++ b/crypto/curve25519/asm/x25519-asm-arm.S
@@ -2129,8 +2129,8 @@ vpop {q4,q5,q6,q7} bx lr +#endif /* !OPENSSL_NO_ASM && __arm__ && !__APPLE__ */ + #if defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif - -#endif /* !OPENSSL_NO_ASM && __arm__ && !__APPLE__ */
diff --git a/crypto/hrss/asm/poly_rq_mul.S b/crypto/hrss/asm/poly_rq_mul.S index 0b684c3..d384627 100644 --- a/crypto/hrss/asm/poly_rq_mul.S +++ b/crypto/hrss/asm/poly_rq_mul.S
@@ -8460,8 +8460,8 @@ .cfi_endproc .size poly_Rq_mul,.-poly_Rq_mul -#if defined(__ELF__) -.section .note.GNU-stack,"",@progbits #endif +#if defined(__ELF__) +.section .note.GNU-stack,"",@progbits #endif
diff --git a/crypto/perlasm/arm-xlate.pl b/crypto/perlasm/arm-xlate.pl index adbd239..58904d0 100755 --- a/crypto/perlasm/arm-xlate.pl +++ b/crypto/perlasm/arm-xlate.pl
@@ -228,10 +228,10 @@ print "\n"; } -# See https://www.airs.com/blog/archives/518. -print ".section\t.note.GNU-stack,\"\",\%progbits\n" if ($flavour =~ /linux/); - print "#endif\n" if ($flavour eq "linux32" || $flavour eq "linux64"); print "#endif // !OPENSSL_NO_ASM\n"; +# See https://www.airs.com/blog/archives/518. +print ".section\t.note.GNU-stack,\"\",\%progbits\n" if ($flavour =~ /linux/); + close STDOUT;
diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl index f8e42a2..4f22c36 100644 --- a/crypto/perlasm/ppc-xlate.pl +++ b/crypto/perlasm/ppc-xlate.pl
@@ -309,9 +309,9 @@ print "\n"; } +print "#endif // !OPENSSL_NO_ASM && __powerpc64__\n"; + # See https://www.airs.com/blog/archives/518. print ".section\t.note.GNU-stack,\"\",\@progbits\n" if ($flavour =~ /linux/); -print "#endif // !OPENSSL_NO_ASM && __powerpc64__\n"; - close STDOUT;
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index d2854cf..4a41a24 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl
@@ -1260,10 +1260,9 @@ print "\n$current_segment\tENDS\n" if ($current_segment && $masm); print "END\n" if ($masm); +print "#endif\n" if ($gas); # See https://www.airs.com/blog/archives/518. print ".section\t.note.GNU-stack,\"\",\@progbits\n" if ($elf); -print "#endif\n" if ($gas); - close STDOUT;
diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index b331cd4..2d19425 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl
@@ -297,9 +297,9 @@ ___ } print @out; + print "#endif\n" unless ($win32 || $netware); # See https://www.airs.com/blog/archives/518. print ".section\t.note.GNU-stack,\"\",\@progbits\n" if ($elf); - print "#endif\n" unless ($win32 || $netware); } sub ::asm_init
diff --git a/crypto/poly1305/poly1305_arm_asm.S b/crypto/poly1305/poly1305_arm_asm.S index 77b3c48..80a4b31 100644 --- a/crypto/poly1305/poly1305_arm_asm.S +++ b/crypto/poly1305/poly1305_arm_asm.S
@@ -2022,8 +2022,8 @@ add sp,sp,#0 bx lr +#endif /* __arm__ && !OPENSSL_NO_ASM && !__APPLE__ */ + #if defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif - -#endif /* __arm__ && !OPENSSL_NO_ASM && !__APPLE__ */