diff options
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86gas.pl')
| -rw-r--r-- | src/lib/libcrypto/perlasm/x86gas.pl | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/lib/libcrypto/perlasm/x86gas.pl b/src/lib/libcrypto/perlasm/x86gas.pl index 9a1cce026e..d4baea514b 100644 --- a/src/lib/libcrypto/perlasm/x86gas.pl +++ b/src/lib/libcrypto/perlasm/x86gas.pl | |||
| @@ -45,9 +45,8 @@ sub ::generic | |||
| 45 | undef $suffix if ($dst =~ m/^%[xm]/o || $src =~ m/^%[xm]/o); | 45 | undef $suffix if ($dst =~ m/^%[xm]/o || $src =~ m/^%[xm]/o); |
| 46 | 46 | ||
| 47 | if ($#_==0) { &::emit($opcode); } | 47 | if ($#_==0) { &::emit($opcode); } |
| 48 | elsif ($opcode =~ m/^j/o && $#_==1) { &::emit($opcode,@arg); } | 48 | elsif ($#_==1 && $opcode =~ m/^(call|clflush|j|loop|set)/o) |
| 49 | elsif ($opcode eq "call" && $#_==1) { &::emit($opcode,@arg); } | 49 | { &::emit($opcode,@arg); } |
| 50 | elsif ($opcode =~ m/^set/&& $#_==1) { &::emit($opcode,@arg); } | ||
| 51 | else { &::emit($opcode.$suffix,@arg);} | 50 | else { &::emit($opcode.$suffix,@arg);} |
| 52 | 51 | ||
| 53 | 1; | 52 | 1; |
| @@ -91,6 +90,7 @@ sub ::DWP | |||
| 91 | } | 90 | } |
| 92 | sub ::QWP { &::DWP(@_); } | 91 | sub ::QWP { &::DWP(@_); } |
| 93 | sub ::BP { &::DWP(@_); } | 92 | sub ::BP { &::DWP(@_); } |
| 93 | sub ::WP { &::DWP(@_); } | ||
| 94 | sub ::BC { @_; } | 94 | sub ::BC { @_; } |
| 95 | sub ::DWC { @_; } | 95 | sub ::DWC { @_; } |
| 96 | 96 | ||
| @@ -149,22 +149,24 @@ sub ::public_label | |||
| 149 | { push(@out,".globl\t".&::LABEL($_[0],$nmdecor.$_[0])."\n"); } | 149 | { push(@out,".globl\t".&::LABEL($_[0],$nmdecor.$_[0])."\n"); } |
| 150 | 150 | ||
| 151 | sub ::file_end | 151 | sub ::file_end |
| 152 | { if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) { | 152 | { if ($::macosx) |
| 153 | my $tmp=".comm\t${nmdecor}OPENSSL_ia32cap_P,4"; | ||
| 154 | if ($::elf) { push (@out,"$tmp,4\n"); } | ||
| 155 | else { push (@out,"$tmp\n"); } | ||
| 156 | } | ||
| 157 | if ($::macosx) | ||
| 158 | { if (%non_lazy_ptr) | 153 | { if (%non_lazy_ptr) |
| 159 | { push(@out,".section __IMPORT,__pointers,non_lazy_symbol_pointers\n"); | 154 | { push(@out,".section __IMPORT,__pointers,non_lazy_symbol_pointers\n"); |
| 160 | foreach $i (keys %non_lazy_ptr) | 155 | foreach $i (keys %non_lazy_ptr) |
| 161 | { push(@out,"$non_lazy_ptr{$i}:\n.indirect_symbol\t$i\n.long\t0\n"); } | 156 | { push(@out,"$non_lazy_ptr{$i}:\n.indirect_symbol\t$i\n.long\t0\n"); } |
| 162 | } | 157 | } |
| 163 | } | 158 | } |
| 159 | if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) { | ||
| 160 | my $tmp=".comm\t${nmdecor}OPENSSL_ia32cap_P,8"; | ||
| 161 | if ($::macosx) { push (@out,"$tmp,2\n"); } | ||
| 162 | elsif ($::elf) { push (@out,"$tmp,4\n"); } | ||
| 163 | else { push (@out,"$tmp\n"); } | ||
| 164 | } | ||
| 164 | push(@out,$initseg) if ($initseg); | 165 | push(@out,$initseg) if ($initseg); |
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | sub ::data_byte { push(@out,".byte\t".join(',',@_)."\n"); } | 168 | sub ::data_byte { push(@out,".byte\t".join(',',@_)."\n"); } |
| 169 | sub ::data_short{ push(@out,".value\t".join(',',@_)."\n"); } | ||
| 168 | sub ::data_word { push(@out,".long\t".join(',',@_)."\n"); } | 170 | sub ::data_word { push(@out,".long\t".join(',',@_)."\n"); } |
| 169 | 171 | ||
| 170 | sub ::align | 172 | sub ::align |
| @@ -189,7 +191,7 @@ sub ::picmeup | |||
| 189 | &::lea($dst,&::DWP($sym)); | 191 | &::lea($dst,&::DWP($sym)); |
| 190 | &::emitraw("#endif /* PIC */"); | 192 | &::emitraw("#endif /* PIC */"); |
| 191 | } | 193 | } |
| 192 | elsif ($::pic && ($::elf || $::aout)) | 194 | if (($::pic && ($::elf || $::aout)) || $::macosx) |
| 193 | { if (!defined($base)) | 195 | { if (!defined($base)) |
| 194 | { &::call(&::label("PIC_me_up")); | 196 | { &::call(&::label("PIC_me_up")); |
| 195 | &::set_label("PIC_me_up"); | 197 | &::set_label("PIC_me_up"); |
| @@ -225,14 +227,17 @@ PIC_EPILOGUE | |||
| 225 | .align $align | 227 | .align $align |
| 226 | .Linitalign: | 228 | .Linitalign: |
| 227 | ___ | 229 | ___ |
| 230 | } elsif ($::android) | ||
| 231 | { $initseg.=<<___; | ||
| 232 | .section .init_array | ||
| 233 | .align 4 | ||
| 234 | .long $f | ||
| 235 | ___ | ||
| 228 | } | 236 | } |
| 229 | elsif ($::elf) | 237 | elsif ($::elf) |
| 230 | { $initseg.=<<___; | 238 | { $initseg.=<<___; |
| 231 | .section .init | 239 | .section .init |
| 232 | call $f | 240 | call $f |
| 233 | jmp .Linitalign | ||
| 234 | .align $align | ||
| 235 | .Linitalign: | ||
| 236 | ___ | 241 | ___ |
| 237 | } | 242 | } |
| 238 | elsif ($::coff) | 243 | elsif ($::coff) |
