diff options
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86unix.pl')
-rw-r--r-- | src/lib/libcrypto/perlasm/x86unix.pl | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/src/lib/libcrypto/perlasm/x86unix.pl b/src/lib/libcrypto/perlasm/x86unix.pl index 02d72a32bc..ae8f0964dc 100644 --- a/src/lib/libcrypto/perlasm/x86unix.pl +++ b/src/lib/libcrypto/perlasm/x86unix.pl | |||
@@ -345,7 +345,7 @@ sub main'file | |||
345 | local($file)=@_; | 345 | local($file)=@_; |
346 | 346 | ||
347 | if ($main'openbsd) | 347 | if ($main'openbsd) |
348 | { push(@out,"#include <machine/asm.h>\n"); return; } | 348 | { push(@out,"#include <machine/asm.h>\n"); } |
349 | 349 | ||
350 | local($tmp)=<<"EOF"; | 350 | local($tmp)=<<"EOF"; |
351 | .file "$file.s" | 351 | .file "$file.s" |
@@ -355,13 +355,17 @@ EOF | |||
355 | 355 | ||
356 | sub main'function_begin | 356 | sub main'function_begin |
357 | { | 357 | { |
358 | local($func)=@_; | 358 | local($func,$junk,$llabel)=@_; |
359 | 359 | ||
360 | &main'external_label($func); | 360 | &main'external_label($func); |
361 | $func=$under.$func; | 361 | $func=$under.$func; |
362 | 362 | ||
363 | if ($main'openbsd) | 363 | if ($main'openbsd) |
364 | { push (@out, "\nENTRY($func)\n"); goto skip; } | 364 | { |
365 | push (@out, "\nENTRY($func)\n"); | ||
366 | push (@out, "$llabel:\n") if $llabel; | ||
367 | goto skip; | ||
368 | } | ||
365 | 369 | ||
366 | local($tmp)=<<"EOF"; | 370 | local($tmp)=<<"EOF"; |
367 | .text | 371 | .text |
@@ -417,6 +421,44 @@ skip: | |||
417 | $stack=4; | 421 | $stack=4; |
418 | } | 422 | } |
419 | 423 | ||
424 | # Like function_begin_B but with static linkage | ||
425 | sub main'function_begin_C | ||
426 | { | ||
427 | local($func,$extra)=@_; | ||
428 | |||
429 | &main'external_label($func); | ||
430 | $func=$under.$func; | ||
431 | |||
432 | if ($main'openbsd) | ||
433 | { | ||
434 | local($tmp)=<<"EOF"; | ||
435 | .text | ||
436 | _ALIGN_TEXT | ||
437 | .type $func,\@function | ||
438 | $func: | ||
439 | EOF | ||
440 | push(@out, $tmp); | ||
441 | goto skip; | ||
442 | } | ||
443 | |||
444 | local($tmp)=<<"EOF"; | ||
445 | .text | ||
446 | .globl $func | ||
447 | EOF | ||
448 | push(@out,$tmp); | ||
449 | if ($main'cpp) | ||
450 | { push(@out,"TYPE($func,\@function)\n"); } | ||
451 | elsif ($main'coff) | ||
452 | { $tmp=push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } | ||
453 | elsif ($main'aout and !$main'pic) | ||
454 | { } | ||
455 | else { push(@out,".type $func,\@function\n"); } | ||
456 | push(@out,".align\t$align\n"); | ||
457 | push(@out,"$func:\n"); | ||
458 | skip: | ||
459 | $stack=4; | ||
460 | } | ||
461 | |||
420 | sub main'function_end | 462 | sub main'function_end |
421 | { | 463 | { |
422 | local($func)=@_; | 464 | local($func)=@_; |
@@ -474,6 +516,8 @@ sub main'function_end_B | |||
474 | %label=(); | 516 | %label=(); |
475 | } | 517 | } |
476 | 518 | ||
519 | sub main'function_end_C { function_end_B(@_); } | ||
520 | |||
477 | sub main'wparam | 521 | sub main'wparam |
478 | { | 522 | { |
479 | local($num)=@_; | 523 | local($num)=@_; |
@@ -510,7 +554,7 @@ sub main'swtmp | |||
510 | 554 | ||
511 | sub main'comment | 555 | sub main'comment |
512 | { | 556 | { |
513 | if (!defined($com_start) or $main'elf) | 557 | if (!defined($com_start) or (!$main'openbsd && $main'elf)) |
514 | { # Regarding $main'elf above... | 558 | { # Regarding $main'elf above... |
515 | # GNU and SVR4 as'es use different comment delimiters, | 559 | # GNU and SVR4 as'es use different comment delimiters, |
516 | push(@out,"\n"); # so we just skip ELF comments... | 560 | push(@out,"\n"); # so we just skip ELF comments... |
@@ -731,7 +775,9 @@ sub main'initseg | |||
731 | { | 775 | { |
732 | $tmp=<<___; | 776 | $tmp=<<___; |
733 | .section .init | 777 | .section .init |
734 | call $under$f | 778 | PIC_PROLOGUE |
779 | call PIC_PLT($under$f) | ||
780 | PIC_EPILOGUE | ||
735 | jmp .Linitalign | 781 | jmp .Linitalign |
736 | .align $align | 782 | .align $align |
737 | .Linitalign: | 783 | .Linitalign: |