summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/perlasm/x86gas.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86gas.pl')
-rw-r--r--src/lib/libcrypto/perlasm/x86gas.pl21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/perlasm/x86gas.pl b/src/lib/libcrypto/perlasm/x86gas.pl
index 682a3a3163..d4baea514b 100644
--- a/src/lib/libcrypto/perlasm/x86gas.pl
+++ b/src/lib/libcrypto/perlasm/x86gas.pl
@@ -182,6 +182,15 @@ sub ::align
182sub ::picmeup 182sub ::picmeup
183{ my($dst,$sym,$base,$reflabel)=@_; 183{ my($dst,$sym,$base,$reflabel)=@_;
184 184
185 if ($::openbsd)
186 { &::emitraw("#if defined(PIC) || defined(__PIC__)");
187 &::emitraw("PIC_PROLOGUE");
188 &::mov($dst, &::DWP("PIC_GOT($sym)"));
189 &::emitraw("PIC_EPILOGUE");
190 &::emitraw("#else /* PIC */");
191 &::lea($dst,&::DWP($sym));
192 &::emitraw("#endif /* PIC */");
193 }
185 if (($::pic && ($::elf || $::aout)) || $::macosx) 194 if (($::pic && ($::elf || $::aout)) || $::macosx)
186 { if (!defined($base)) 195 { if (!defined($base))
187 { &::call(&::label("PIC_me_up")); 196 { &::call(&::label("PIC_me_up"));
@@ -208,7 +217,17 @@ sub ::picmeup
208sub ::initseg 217sub ::initseg
209{ my $f=$nmdecor.shift; 218{ my $f=$nmdecor.shift;
210 219
211 if ($::android) 220 if ($::openbsd)
221 { $initseg.=<<___;
222.section .init
223PIC_PROLOGUE
224 call PIC_PLT($f)
225PIC_EPILOGUE
226 jmp .Linitalign
227.align $align
228.Linitalign:
229___
230 } elsif ($::android)
212 { $initseg.=<<___; 231 { $initseg.=<<___;
213.section .init_array 232.section .init_array
214.align 4 233.align 4