1*4882a593SmuzhiyunFrom 07a0bbdd179a52907485fd793f0df31c097447af Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Andy Polyakov <appro@openssl.org>
3*4882a593SmuzhiyunDate: Sun, 5 May 2019 18:25:50 +0200
4*4882a593SmuzhiyunSubject: [PATCH] crypto/perlasm/ppc-xlate.pl: add linux64v2 flavour
5*4882a593SmuzhiyunMIME-Version: 1.0
6*4882a593SmuzhiyunContent-Type: text/plain; charset=UTF-8
7*4882a593SmuzhiyunContent-Transfer-Encoding: 8bit
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThis is a big endian ELFv2 configuration. ELFv2 was already being
10*4882a593Smuzhiyunused for little endian, and big endian was traditionally ELFv1
11*4882a593Smuzhiyunbut there are practical configurations that use ELFv2 with big
12*4882a593Smuzhiyunendian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.)
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunReviewed-by: Paul Dale <paul.dale@oracle.com>
15*4882a593SmuzhiyunReviewed-by: Richard Levitte <levitte@openssl.org>
16*4882a593Smuzhiyun(Merged from https://github.com/openssl/openssl/pull/8883)
17*4882a593SmuzhiyunSigned-off-by: Vincent Fazio <vfazio@xes-inc.com>
18*4882a593Smuzhiyun---
19*4882a593Smuzhiyun crypto/perlasm/ppc-xlate.pl | 8 ++++----
20*4882a593Smuzhiyun 1 file changed, 4 insertions(+), 4 deletions(-)
21*4882a593Smuzhiyun
22*4882a593Smuzhiyundiff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
23*4882a593Smuzhiyunindex d220c6245b..eec82b8d48 100755
24*4882a593Smuzhiyun--- a/crypto/perlasm/ppc-xlate.pl
25*4882a593Smuzhiyun+++ b/crypto/perlasm/ppc-xlate.pl
26*4882a593Smuzhiyun@@ -49,7 +49,7 @@ my $globl = sub {
27*4882a593Smuzhiyun 	/osx/		&& do { $name = "_$name";
28*4882a593Smuzhiyun 				last;
29*4882a593Smuzhiyun 			      };
30*4882a593Smuzhiyun-	/linux.*(32|64le)/
31*4882a593Smuzhiyun+	/linux.*(32|64(le|v2))/
32*4882a593Smuzhiyun 			&& do {	$ret .= ".globl	$name";
33*4882a593Smuzhiyun 				if (!$$type) {
34*4882a593Smuzhiyun 				    $ret .= "\n.type	$name,\@function";
35*4882a593Smuzhiyun@@ -80,7 +80,7 @@ my $globl = sub {
36*4882a593Smuzhiyun };
37*4882a593Smuzhiyun my $text = sub {
38*4882a593Smuzhiyun     my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
39*4882a593Smuzhiyun-    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64le/);
40*4882a593Smuzhiyun+    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64(le|v2)/);
41*4882a593Smuzhiyun     $ret;
42*4882a593Smuzhiyun };
43*4882a593Smuzhiyun my $machine = sub {
44*4882a593Smuzhiyun@@ -186,7 +186,7 @@ my $vmr = sub {
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun # Some ABIs specify vrsave, special-purpose register #256, as reserved
47*4882a593Smuzhiyun # for system use.
48*4882a593Smuzhiyun-my $no_vrsave = ($flavour =~ /aix|linux64le/);
49*4882a593Smuzhiyun+my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/);
50*4882a593Smuzhiyun my $mtspr = sub {
51*4882a593Smuzhiyun     my ($f,$idx,$ra) = @_;
52*4882a593Smuzhiyun     if ($idx == 256 && $no_vrsave) {
53*4882a593Smuzhiyun@@ -318,7 +318,7 @@ while($line=<>) {
54*4882a593Smuzhiyun 	if ($label) {
55*4882a593Smuzhiyun 	    my $xlated = ($GLOBALS{$label} or $label);
56*4882a593Smuzhiyun 	    print "$xlated:";
57*4882a593Smuzhiyun-	    if ($flavour =~ /linux.*64le/) {
58*4882a593Smuzhiyun+	    if ($flavour =~ /linux.*64(le|v2)/) {
59*4882a593Smuzhiyun 		if ($TYPES{$label} =~ /function/) {
60*4882a593Smuzhiyun 		    printf "\n.localentry	%s,0\n",$xlated;
61*4882a593Smuzhiyun 		}
62*4882a593Smuzhiyun--
63*4882a593Smuzhiyun2.25.0
64*4882a593Smuzhiyun
65