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.pl24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/libcrypto/perlasm/x86gas.pl b/src/lib/libcrypto/perlasm/x86gas.pl
index 6eab727fd4..15e17f25d0 100644
--- a/src/lib/libcrypto/perlasm/x86gas.pl
+++ b/src/lib/libcrypto/perlasm/x86gas.pl
@@ -180,7 +180,16 @@ sub ::align
180sub ::picmeup 180sub ::picmeup
181{ my($dst,$sym,$base,$reflabel)=@_; 181{ my($dst,$sym,$base,$reflabel)=@_;
182 182
183 if ($::pic && ($::elf || $::aout)) 183 if ($::openbsd)
184 { &::emitraw("#ifdef PIC");
185 &::emitraw("PIC_PROLOGUE");
186 &::mov($dst, &::DWP("PIC_GOT($sym)"));
187 &::emitraw("PIC_EPILOGUE");
188 &::emitraw("#else /* PIC */");
189 &::lea($dst,&::DWP($sym));
190 &::emitraw("#endif /* PIC */");
191 }
192 elsif ($::pic && ($::elf || $::aout))
184 { if (!defined($base)) 193 { if (!defined($base))
185 { &::call(&::label("PIC_me_up")); 194 { &::call(&::label("PIC_me_up"));
186 &::set_label("PIC_me_up"); 195 &::set_label("PIC_me_up");
@@ -206,7 +215,18 @@ sub ::picmeup
206sub ::initseg 215sub ::initseg
207{ my $f=$nmdecor.shift; 216{ my $f=$nmdecor.shift;
208 217
209 if ($::elf) 218 if ($::openbsd)
219 { $initseg.=<<___;
220.section .init
221PIC_PROLOGUE
222 call PIC_PLT($f)
223PIC_EPILOGUE
224 jmp .Linitalign
225.align $align
226.Linitalign:
227___
228 }
229 elsif ($::elf)
210 { $initseg.=<<___; 230 { $initseg.=<<___;
211.section .init 231.section .init
212 call $f 232 call $f