diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-12-07 15:55:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-12-07 15:55:59 +0000 |
commit | 65e06d8239553d4c1e4b609485c85096953bfc1e (patch) | |
tree | be307096e097852ec329ca84360a7275c85f00d0 /lib/libcrypto | |
parent | 022316b4f161c1d40dd13543187a362b5958af5c (diff) |
Make sure to load absolute symbol address with `dla' instead of `la' when
generating code for 64-bit mips userland.
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/aes/asm/aes-mips.pl | 14 | ||||
-rw-r--r-- | lib/libcrypto/sha/asm/sha512-mips.pl | 8 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lib/libcrypto/aes/asm/aes-mips.pl b/lib/libcrypto/aes/asm/aes-mips.pl index 5307c05cac6..2f6ff74ffe1 100644 --- a/lib/libcrypto/aes/asm/aes-mips.pl +++ b/lib/libcrypto/aes/asm/aes-mips.pl @@ -49,6 +49,12 @@ # $flavour = shift; # supported flavours are o32,n32,64,nubi32,nubi64 +if ($flavour =~ /64/i) { + $LA="dla"; +} else { + $LA="la"; +} + if ($flavour =~ /64|n32/i) { $PTR_ADD="dadd"; # incidentally works even on n32 $PTR_SUB="dsub"; # incidentally works even on n32 @@ -385,7 +391,7 @@ $code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification ___ $code.=<<___; .set reorder - la $Tbl,AES_Te # PIC-ified 'load address' + $LA $Tbl,AES_Te # PIC-ified 'load address' lwl $s0,0+$MSB($inp) lwl $s1,4+$MSB($inp) @@ -721,7 +727,7 @@ $code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification ___ $code.=<<___; .set reorder - la $Tbl,AES_Td # PIC-ified 'load address' + $LA $Tbl,AES_Td # PIC-ified 'load address' lwl $s0,0+$MSB($inp) lwl $s1,4+$MSB($inp) @@ -1060,7 +1066,7 @@ $code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification ___ $code.=<<___; .set reorder - la $Tbl,AES_Te # PIC-ified 'load address' + $LA $Tbl,AES_Te # PIC-ified 'load address' bal _mips_AES_set_encrypt_key @@ -1115,7 +1121,7 @@ $code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification ___ $code.=<<___; .set reorder - la $Tbl,AES_Te # PIC-ified 'load address' + $LA $Tbl,AES_Te # PIC-ified 'load address' bal _mips_AES_set_encrypt_key diff --git a/lib/libcrypto/sha/asm/sha512-mips.pl b/lib/libcrypto/sha/asm/sha512-mips.pl index 2714794c2f0..495a000695a 100644 --- a/lib/libcrypto/sha/asm/sha512-mips.pl +++ b/lib/libcrypto/sha/asm/sha512-mips.pl @@ -47,6 +47,12 @@ # $flavour = shift; # supported flavours are o32,n32,64,nubi32,nubi64 +if ($flavour =~ /64/i) { + $LA="dla"; +} else { + $LA="la"; +} + if ($flavour =~ /64|n32/i) { $PTR_ADD="dadd"; # incidentally works even on n32 $PTR_SUB="dsub"; # incidentally works even on n32 @@ -284,7 +290,7 @@ $code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification ___ $code.=<<___; .set reorder - la $Ktbl,K${label} # PIC-ified 'load address' + $LA $Ktbl,K${label} # PIC-ified 'load address' $LD $A,0*$SZ($ctx) # load context $LD $B,1*$SZ($ctx) |