From ed28aef8b455be436f252dfceac49a958a92e53b Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 6 Sep 2011 20:45:36 +0000 Subject: Padlock engine: make it independent of inline assembler. --- crypto/perlasm/x86masm.pl | 7 +++++++ crypto/perlasm/x86nasm.pl | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'crypto/perlasm') diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl index 6154b079b9..ee446de5c1 100644 --- a/crypto/perlasm/x86masm.pl +++ b/crypto/perlasm/x86masm.pl @@ -186,4 +186,11 @@ ___ sub ::dataseg { push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA"; } +sub ::safeseh +{ my $nm=shift; + push(@out,"IF \@Version GE 710\n"); + push(@out,".SAFESEH ".&::LABEL($nm,$nmdecor.$nm)."\n"); + push(@out,"ENDIF\n"); +} + 1; diff --git a/crypto/perlasm/x86nasm.pl b/crypto/perlasm/x86nasm.pl index 23a84ba563..ca2511c9eb 100644 --- a/crypto/perlasm/x86nasm.pl +++ b/crypto/perlasm/x86nasm.pl @@ -167,4 +167,11 @@ sub ::dataseg else { push(@out,"section\t.data align=4\n"); } } +sub ::safeseh +{ my $nm=shift; + push(@out,"%if __NASM_VERSION_ID__ >= 0x02030000\n"); + push(@out,"safeseh ".&::LABEL($nm,$nmdecor.$nm)."\n"); + push(@out,"%endif\n"); +} + 1; -- cgit v1.2.3