uclient: update to Git HEAD (2024-04-18)
[openwrt/openwrt.git] / package / libs / openssl / patches / 001-crypto-perlasm-ppc-xlate.pl-add-linux64v2-flavour.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Andy Polyakov <appro@openssl.org>
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
9 This is a big endian ELFv2 configuration. ELFv2 was already being
10 used for little endian, and big endian was traditionally ELFv1
11 but there are practical configurations that use ELFv2 with big
12 endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.)
13
14 Reviewed-by: Paul Dale <paul.dale@oracle.com>
15 Reviewed-by: Richard Levitte <levitte@openssl.org>
16 (Merged from https://github.com/openssl/openssl/pull/8883)
17
18 diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
19 --- a/crypto/perlasm/ppc-xlate.pl
20 +++ b/crypto/perlasm/ppc-xlate.pl
21 @@ -49,7 +49,7 @@ my $globl = sub {
22 /osx/ && do { $name = "_$name";
23 last;
24 };
25 - /linux.*(32|64le)/
26 + /linux.*(32|64(le|v2))/
27 && do { $ret .= ".globl $name";
28 if (!$$type) {
29 $ret .= "\n.type $name,\@function";
30 @@ -80,7 +80,7 @@ my $globl = sub {
31 };
32 my $text = sub {
33 my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
34 - $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64le/);
35 + $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64(le|v2)/);
36 $ret;
37 };
38 my $machine = sub {
39 @@ -186,7 +186,7 @@ my $vmr = sub {
40
41 # Some ABIs specify vrsave, special-purpose register #256, as reserved
42 # for system use.
43 -my $no_vrsave = ($flavour =~ /aix|linux64le/);
44 +my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/);
45 my $mtspr = sub {
46 my ($f,$idx,$ra) = @_;
47 if ($idx == 256 && $no_vrsave) {
48 @@ -318,7 +318,7 @@ while($line=<>) {
49 if ($label) {
50 my $xlated = ($GLOBALS{$label} or $label);
51 print "$xlated:";
52 - if ($flavour =~ /linux.*64le/) {
53 + if ($flavour =~ /linux.*64(le|v2)/) {
54 if ($TYPES{$label} =~ /function/) {
55 printf "\n.localentry %s,0\n",$xlated;
56 }