Non-executable stack in asm.
[openssl.git] / crypto / x86_64cpuid.pl
index 862118f285858439384cbed181c056bd6b58501d..72010c9cbe020c018ce1795158210184ca3f6e36 100644 (file)
@@ -16,6 +16,13 @@ print<<___;
 .section       .init
        call    OPENSSL_cpuid_setup
 
+___
+
+if ($flavour =~ /elf/) {
+  print ".section .note.GNU-stack,\"\",\@progbits\n"
+}
+
+print<<___;
 .text
 
 .globl OPENSSL_atomic_add
@@ -145,11 +152,14 @@ OPENSSL_cleanse:
        xor     %rax,%rax
        cmp     \$15,$arg2
        jae     .Lot
+       cmp     \$0,$arg2
+       je      .Lret
 .Little:
        mov     %al,($arg1)
        sub     \$1,$arg2
        lea     1($arg1),$arg1
        jnz     .Little
+.Lret:
        ret
 .align 16
 .Lot: