aboutsummaryrefslogtreecommitdiff
path: root/crypto/perlasm/arm-xlate.pl
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/perlasm/arm-xlate.pl')
-rwxr-xr-xcrypto/perlasm/arm-xlate.pl28
1 files changed, 22 insertions, 6 deletions
diff --git a/crypto/perlasm/arm-xlate.pl b/crypto/perlasm/arm-xlate.pl
index 48819be54052..38d570c79017 100755
--- a/crypto/perlasm/arm-xlate.pl
+++ b/crypto/perlasm/arm-xlate.pl
@@ -1,7 +1,7 @@
#! /usr/bin/env perl
-# Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
#
-# Licensed under the OpenSSL license (the "License"). You may not use
+# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
@@ -28,6 +28,13 @@ my $fpu = sub {
if ($flavour =~ /linux/) { ".fpu\t".join(',',@_); }
else { ""; }
};
+my $rodata = sub {
+ SWITCH: for ($flavour) {
+ /linux/ && return ".section\t.rodata";
+ /ios/ && return ".section\t__TEXT,__const";
+ last;
+ }
+};
my $hidden = sub {
if ($flavour =~ /ios/) { ".private_extern\t".join(',',@_); }
else { ".hidden\t".join(',',@_); }
@@ -96,6 +103,12 @@ my $asciz = sub {
{ ""; }
};
+my $adrp = sub {
+ my ($args,$comment) = split(m|\s*//|,shift);
+ "\tadrp\t$args\@PAGE";
+} if ($flavour =~ /ios64/);
+
+
sub range {
my ($r,$sfx,$start,$end) = @_;
@@ -125,6 +138,10 @@ sub expand_line {
$line =~ s/\b(\w+)/$GLOBALS{$1} or $1/ge;
+ if ($flavour =~ /ios64/) {
+ $line =~ s/#:lo12:(\w+)/$1\@PAGEOFF/;
+ }
+
return $line;
}
@@ -133,7 +150,7 @@ while(my $line=<>) {
if ($line =~ m/^\s*(#|@|\/\/)/) { print $line; next; }
$line =~ s|/\*.*\*/||; # get rid of C-style comments...
- $line =~ s|^\s+||; # ... and skip white spaces in beginning...
+ $line =~ s|^\s+||; # ... and skip whitespace in beginning...
$line =~ s|\s+$||; # ... and at the end
{
@@ -142,9 +159,8 @@ while(my $line=<>) {
}
{
- $line =~ s|(^[\.\w]+)\:\s*||;
- my $label = $1;
- if ($label) {
+ if ($line =~ s|(^[\.\w]+)\:\s*||) {
+ my $label = $1;
printf "%s:",($GLOBALS{$label} or $label);
}
}