summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/perlasm/x86gas.pl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/perlasm/x86gas.pl34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/lib/libcrypto/perlasm/x86gas.pl b/src/lib/libcrypto/perlasm/x86gas.pl
index 6eab727fd4..682a3a3163 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}
92sub ::QWP { &::DWP(@_); } 91sub ::QWP { &::DWP(@_); }
93sub ::BP { &::DWP(@_); } 92sub ::BP { &::DWP(@_); }
93sub ::WP { &::DWP(@_); }
94sub ::BC { @_; } 94sub ::BC { @_; }
95sub ::DWC { @_; } 95sub ::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
151sub ::file_end 151sub ::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
167sub ::data_byte { push(@out,".byte\t".join(',',@_)."\n"); } 168sub ::data_byte { push(@out,".byte\t".join(',',@_)."\n"); }
169sub ::data_short{ push(@out,".value\t".join(',',@_)."\n"); }
168sub ::data_word { push(@out,".long\t".join(',',@_)."\n"); } 170sub ::data_word { push(@out,".long\t".join(',',@_)."\n"); }
169 171
170sub ::align 172sub ::align
@@ -180,7 +182,7 @@ sub ::align
180sub ::picmeup 182sub ::picmeup
181{ my($dst,$sym,$base,$reflabel)=@_; 183{ my($dst,$sym,$base,$reflabel)=@_;
182 184
183 if ($::pic && ($::elf || $::aout)) 185 if (($::pic && ($::elf || $::aout)) || $::macosx)
184 { if (!defined($base)) 186 { if (!defined($base))
185 { &::call(&::label("PIC_me_up")); 187 { &::call(&::label("PIC_me_up"));
186 &::set_label("PIC_me_up"); 188 &::set_label("PIC_me_up");
@@ -206,13 +208,17 @@ sub ::picmeup
206sub ::initseg 208sub ::initseg
207{ my $f=$nmdecor.shift; 209{ my $f=$nmdecor.shift;
208 210
209 if ($::elf) 211 if ($::android)
212 { $initseg.=<<___;
213.section .init_array
214.align 4
215.long $f
216___
217 }
218 elsif ($::elf)
210 { $initseg.=<<___; 219 { $initseg.=<<___;
211.section .init 220.section .init
212 call $f 221 call $f
213 jmp .Linitalign
214.align $align
215.Linitalign:
216___ 222___
217 } 223 }
218 elsif ($::coff) 224 elsif ($::coff)