diff options
author | nectar <nectar@FreeBSD.org> | 2003-02-19 23:17:42 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-02-19 23:17:42 +0000 |
commit | 6c9986c446b6cf77f5e83d111dbcca682d6fdd71 (patch) | |
tree | e5eb3878430323e978956db174c9c51c7997ba4a /crypto/openssl/crypto/perlasm | |
parent | b6c07e9a21ba42613fc3906d3efb586dd5c9a846 (diff) | |
download | FreeBSD-src-6c9986c446b6cf77f5e83d111dbcca682d6fdd71.zip FreeBSD-src-6c9986c446b6cf77f5e83d111dbcca682d6fdd71.tar.gz |
Vendor import of OpenSSL 0.9.7a.
Diffstat (limited to 'crypto/openssl/crypto/perlasm')
-rw-r--r-- | crypto/openssl/crypto/perlasm/x86asm.pl | 9 | ||||
-rw-r--r-- | crypto/openssl/crypto/perlasm/x86ms.pl | 6 | ||||
-rw-r--r-- | crypto/openssl/crypto/perlasm/x86nasm.pl | 6 | ||||
-rw-r--r-- | crypto/openssl/crypto/perlasm/x86unix.pl | 32 |
4 files changed, 45 insertions, 8 deletions
diff --git a/crypto/openssl/crypto/perlasm/x86asm.pl b/crypto/openssl/crypto/perlasm/x86asm.pl index 9a3d85b..1cb96e9 100644 --- a/crypto/openssl/crypto/perlasm/x86asm.pl +++ b/crypto/openssl/crypto/perlasm/x86asm.pl @@ -18,9 +18,9 @@ sub main'asm_init ($type,$fn,$i386)=@_; $filename=$fn; - $cpp=$sol=$aout=$win32=$gaswin=0; + $elf=$cpp=$sol=$aout=$win32=$gaswin=0; if ( ($type eq "elf")) - { require "x86unix.pl"; } + { $elf=1; require "x86unix.pl"; } elsif ( ($type eq "a.out")) { $aout=1; require "x86unix.pl"; } elsif ( ($type eq "gaswin")) @@ -47,6 +47,9 @@ EOF exit(1); } + $pic=0; + for (@ARGV) { $pic=1 if (/\-[fK]PIC/i); } + &asm_init_output(); &comment("Don't even think of reading this code"); @@ -91,7 +94,7 @@ $tmp #undef SIZE #undef TYPE #define SIZE(a,b) -#define TYPE(a,b) +#define TYPE(a,b) .def a; .scl 2; .type 32; .endef #endif /* __CYGWIN || __DJGPP */ #endif diff --git a/crypto/openssl/crypto/perlasm/x86ms.pl b/crypto/openssl/crypto/perlasm/x86ms.pl index abcb7c1..35f1a4d 100644 --- a/crypto/openssl/crypto/perlasm/x86ms.pl +++ b/crypto/openssl/crypto/perlasm/x86ms.pl @@ -367,4 +367,10 @@ sub out1p push(@out,"\t$name\t ".&conv($p1)."\n"); } +sub main'picmeup + { + local($dst,$sym)=@_; + &main'lea($dst,&main'DWP($sym)); + } + sub main'blindpop { &out1("pop",@_); } diff --git a/crypto/openssl/crypto/perlasm/x86nasm.pl b/crypto/openssl/crypto/perlasm/x86nasm.pl index 7965561..f30b746 100644 --- a/crypto/openssl/crypto/perlasm/x86nasm.pl +++ b/crypto/openssl/crypto/perlasm/x86nasm.pl @@ -344,4 +344,10 @@ sub out1p push(@out,"\t$name\t ".&conv($p1)."\n"); } +sub main'picmeup + { + local($dst,$sym)=@_; + &main'lea($dst,&main'DWP($sym)); + } + sub main'blindpop { &out1("pop",@_); } diff --git a/crypto/openssl/crypto/perlasm/x86unix.pl b/crypto/openssl/crypto/perlasm/x86unix.pl index 3ad889f..72bde06 100644 --- a/crypto/openssl/crypto/perlasm/x86unix.pl +++ b/crypto/openssl/crypto/perlasm/x86unix.pl @@ -345,15 +345,15 @@ sub main'function_end popl %ebx popl %ebp ret -.${func}_end: +.L_${func}_end: EOF push(@out,$tmp); if ($main'cpp) - { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); } + { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); } elsif ($main'gaswin) { $tmp=push(@out,"\t.align 4\n"); } - else { push(@out,"\t.size\t$func,.${func}_end-$func\n"); } + else { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); } push(@out,".ident \"$func\"\n"); $stack=0; %label=(); @@ -426,6 +426,11 @@ sub main'swtmp sub main'comment { + if ($main'elf) # GNU and SVR4 as'es use different comment delimiters, + { # so we just skip comments... + push(@out,"\n"); + return; + } foreach (@_) { if (/^\s*$/) @@ -546,7 +551,9 @@ sub popvars sub main'picmeup { local($dst,$sym)=@_; - local($tmp)=<<___; + if ($main'cpp) + { + local($tmp)=<<___; #if (defined(ELF) || defined(SOL)) && defined(PIC) .align 8 call 1f @@ -557,7 +564,22 @@ sub main'picmeup leal $sym,$regs{$dst} #endif ___ - push(@out,$tmp); + push(@out,$tmp); + } + elsif ($main'pic && ($main'elf || $main'aout)) + { + push(@out,"\t.align\t8\n"); + &main'call(&main'label("PIC_me_up")); + &main'set_label("PIC_me_up"); + &main'blindpop($dst); + &main'add($dst,"\$$under"."_GLOBAL_OFFSET_TABLE_+[.-". + &main'label("PIC_me_up") . "]"); + &main'mov($dst,&main'DWP($sym."\@GOT",$dst)); + } + else + { + &main'lea($dst,&main'DWP($sym)); + } } sub main'blindpop { &out1("popl",@_); } |