001-crypto-perlasm-ppc-xlate.pl-add-linux64v2-flavour.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Andy Polyakov <[email protected]>
  3. Date: Sun, 5 May 2019 18:25:50 +0200
  4. Subject: crypto/perlasm/ppc-xlate.pl: add linux64v2 flavour
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This is a big endian ELFv2 configuration. ELFv2 was already being
  9. used for little endian, and big endian was traditionally ELFv1
  10. but there are practical configurations that use ELFv2 with big
  11. endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.)
  12. Reviewed-by: Paul Dale <[email protected]>
  13. Reviewed-by: Richard Levitte <[email protected]>
  14. (Merged from https://github.com/openssl/openssl/pull/8883)
  15. --- a/crypto/perlasm/ppc-xlate.pl
  16. +++ b/crypto/perlasm/ppc-xlate.pl
  17. @@ -49,7 +49,7 @@ my $globl = sub {
  18. /osx/ && do { $name = "_$name";
  19. last;
  20. };
  21. - /linux.*(32|64le)/
  22. + /linux.*(32|64(le|v2))/
  23. && do { $ret .= ".globl $name";
  24. if (!$$type) {
  25. $ret .= "\n.type $name,\@function";
  26. @@ -80,7 +80,7 @@ my $globl = sub {
  27. };
  28. my $text = sub {
  29. my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
  30. - $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64le/);
  31. + $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64(le|v2)/);
  32. $ret;
  33. };
  34. my $machine = sub {
  35. @@ -186,7 +186,7 @@ my $vmr = sub {
  36. # Some ABIs specify vrsave, special-purpose register #256, as reserved
  37. # for system use.
  38. -my $no_vrsave = ($flavour =~ /aix|linux64le/);
  39. +my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/);
  40. my $mtspr = sub {
  41. my ($f,$idx,$ra) = @_;
  42. if ($idx == 256 && $no_vrsave) {
  43. @@ -318,7 +318,7 @@ while($line=<>) {
  44. if ($label) {
  45. my $xlated = ($GLOBALS{$label} or $label);
  46. print "$xlated:";
  47. - if ($flavour =~ /linux.*64le/) {
  48. + if ($flavour =~ /linux.*64(le|v2)/) {
  49. if ($TYPES{$label} =~ /function/) {
  50. printf "\n.localentry %s,0\n",$xlated;
  51. }