From d6019e165497962a0751469441c680aa17349668 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 15 Oct 2013 00:14:39 +0200 Subject: [PATCH] PPC assembly pack: add .size directives. --- crypto/aes/asm/aes-ppc.pl | 2 ++ crypto/bn/asm/ppc-mont.pl | 1 + crypto/bn/asm/ppc.pl | 10 ++++++++++ crypto/bn/asm/ppc64-mont.pl | 1 + crypto/perlasm/ppc-xlate.pl | 8 +++++--- crypto/ppccpuid.pl | 8 ++++++++ crypto/sha/asm/sha1-ppc.pl | 1 + crypto/sha/asm/sha512-ppc.pl | 1 + 8 files changed, 29 insertions(+), 3 deletions(-) diff --git a/crypto/aes/asm/aes-ppc.pl b/crypto/aes/asm/aes-ppc.pl index e10ce880c2..89059d49f4 100644 --- a/crypto/aes/asm/aes-ppc.pl +++ b/crypto/aes/asm/aes-ppc.pl @@ -471,6 +471,7 @@ Lenc_done: .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 +.size .AES_encrypt,.-.AES_encrypt .align 5 Lppc_AES_encrypt: @@ -904,6 +905,7 @@ Ldec_done: .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 +.size .AES_decrypt,.-.AES_decrypt .align 5 Lppc_AES_decrypt: diff --git a/crypto/bn/asm/ppc-mont.pl b/crypto/bn/asm/ppc-mont.pl index f9b6992ccc..da69c6aaaf 100644 --- a/crypto/bn/asm/ppc-mont.pl +++ b/crypto/bn/asm/ppc-mont.pl @@ -325,6 +325,7 @@ Lcopy: ; copy or in-place refresh .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 +.size .bn_mul_mont_int,.-.bn_mul_mont_int .asciz "Montgomery Multiplication for PPC, CRYPTOGAMS by " ___ diff --git a/crypto/bn/asm/ppc.pl b/crypto/bn/asm/ppc.pl index 1249ce2299..04df1fe5cc 100644 --- a/crypto/bn/asm/ppc.pl +++ b/crypto/bn/asm/ppc.pl @@ -392,6 +392,7 @@ $data=<" ___ diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl index a3edd982b6..3ed7bd9665 100755 --- a/crypto/perlasm/ppc-xlate.pl +++ b/crypto/perlasm/ppc-xlate.pl @@ -37,7 +37,6 @@ my $globl = sub { $ret .= ".align 3\n"; $ret .= "$name:\n"; $ret .= ".quad .$name,.TOC.\@tocbase,0\n"; - $ret .= ".size $name,24\n"; $ret .= ".previous\n"; $name = ".$name"; @@ -62,9 +61,12 @@ my $machine = sub { ".machine $arch"; }; my $size = sub { - if ($flavour =~ /linux.*32/) + if ($flavour =~ /linux/) { shift; - ".size " . join(",",@_); + my $name = shift; $name =~ s|^[\.\_]||; + my $ret = ".size $name,.-".($flavour=~/64/?".":"").$name; + $ret .= "\n.size .$name,.-.$name" if ($flavour=~/64/); + $ret; } else { ""; } diff --git a/crypto/ppccpuid.pl b/crypto/ppccpuid.pl index 9f2d96c709..b4990ded85 100755 --- a/crypto/ppccpuid.pl +++ b/crypto/ppccpuid.pl @@ -31,6 +31,7 @@ $code=<<___; blr .long 0 .byte 0,12,0x14,0,0,0,0,0 +.size .OPENSSL_ppc64_probe,.-.OPENSSL_ppc64_probe .globl .OPENSSL_altivec_probe .align 4 @@ -39,6 +40,7 @@ $code=<<___; blr .long 0 .byte 0,12,0x14,0,0,0,0,0 +.size .OPENSSL_altivec_probe,.-..OPENSSL_altivec_probe .globl .OPENSSL_wipe_cpu .align 4 @@ -71,6 +73,7 @@ $code=<<___; blr .long 0 .byte 0,12,0x14,0,0,0,0,0 +.size .OPENSSL_wipe_cpu,.-.OPENSSL_wipe_cpu .globl .OPENSSL_atomic_add .align 4 @@ -84,6 +87,7 @@ Ladd: lwarx r5,0,r3 .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 +.size .OPENSSL_atomic_add,.-.OPENSSL_atomic_add .globl .OPENSSL_rdtsc .align 4 @@ -93,6 +97,7 @@ Ladd: lwarx r5,0,r3 blr .long 0 .byte 0,12,0x14,0,0,0,0,0 +.size .OPENSSL_rdtsc,.-.OPENSSL_rdtsc .globl .OPENSSL_cleanse .align 4 @@ -125,6 +130,7 @@ Laligned: .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 +.size .OPENSSL_cleanse,.-.OPENSSL_cleanse ___ { my ($out,$cnt,$max)=("r3","r4","r5"); @@ -162,6 +168,7 @@ Loop: mftb $tick .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 +.size .OPENSSL_instrument_bus,.-.OPENSSL_instrument_bus .globl .OPENSSL_instrument_bus2 .align 4 @@ -213,6 +220,7 @@ Ldone2: .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 +.size .OPENSSL_instrument_bus2,.-.OPENSSL_instrument_bus2 ___ } diff --git a/crypto/sha/asm/sha1-ppc.pl b/crypto/sha/asm/sha1-ppc.pl index 2140dd2f8d..2a374807f7 100755 --- a/crypto/sha/asm/sha1-ppc.pl +++ b/crypto/sha/asm/sha1-ppc.pl @@ -265,6 +265,7 @@ Ldone: .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 +.size .sha1_block_data_order,.-.sha1_block_data_order ___ # This is private block function, which uses tailored calling diff --git a/crypto/sha/asm/sha512-ppc.pl b/crypto/sha/asm/sha512-ppc.pl index 125a19df8a..d34cd2d033 100755 --- a/crypto/sha/asm/sha512-ppc.pl +++ b/crypto/sha/asm/sha512-ppc.pl @@ -344,6 +344,7 @@ Ldone: .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 +.size $func,.-$func ___ if ($SZ==4 || $SIZE_T==8) {