Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2015-09-25 05:02:02 +0300
committerAdam Langley <agl@google.com>2015-09-29 21:02:14 +0300
commit2ab24a2d40fd193a25d7c94072596a1180cbb460 (patch)
treea7486767f5454a12d8c89c6d42593fb7e984e1ec /crypto/aes
parent502ca43fc8fb7e017e74a2e4646419988a6c363a (diff)
Put arm/aarch64 assembly functions in their own section.
This change causes each global arm or aarch64 asm function to be put into its own section by default. This matches the behaviour of the -ffunction-sections option to GCC and allows the --gc-sections option to the linker to discard unused asm functions on a function-by-function basis. Sometimes several asm functions will share the same data an, in that situation, the data is put into the section of one of the functions and the section of the other function is merged with the added “.global_with_section” directive. Change-Id: I12c9b844d48d104d28beb816764358551eac4456 Reviewed-on: https://boringssl-review.googlesource.com/6003 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/aes')
-rw-r--r--crypto/aes/asm/aes-armv4.pl6
-rw-r--r--crypto/aes/asm/aesv8-armx.pl2
-rw-r--r--crypto/aes/asm/bsaes-armv7.pl2
3 files changed, 8 insertions, 2 deletions
diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
index 882017a6..16ff9909 100644
--- a/crypto/aes/asm/aes-armv4.pl
+++ b/crypto/aes/asm/aes-armv4.pl
@@ -82,6 +82,7 @@ $code=<<___;
# endif
#endif
+.pushsection .text.asm_AES_encrypt,"ax",%progbits
.type AES_Te,%object
.align 5
AES_Te:
@@ -187,6 +188,7 @@ AES_Te:
.word 0x10000000, 0x20000000, 0x40000000, 0x80000000
.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0
.size AES_Te,.-AES_Te
+.popsection
@ void asm_AES_encrypt(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
@@ -440,7 +442,7 @@ _armv4_AES_encrypt:
ldr pc,[sp],#4 @ pop and return
.size _armv4_AES_encrypt,.-_armv4_AES_encrypt
-.global asm_AES_set_encrypt_key
+.global_with_section asm_AES_set_encrypt_key, asm_AES_encrypt
.hidden asm_AES_set_encrypt_key
.type asm_AES_set_encrypt_key,%function
.align 5
@@ -866,6 +868,7 @@ $code.=<<___;
#endif
.size AES_set_enc2dec_key,.-AES_set_enc2dec_key
+.pushsection .text.asm_AES_decrypt,"ax",%progbits
.type AES_Td,%object
.align 5
AES_Td:
@@ -967,6 +970,7 @@ AES_Td:
.byte 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
.size AES_Td,.-AES_Td
+.popsection
@ void asm_AES_decrypt(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl
index 121154a4..d770fa3f 100644
--- a/crypto/aes/asm/aesv8-armx.pl
+++ b/crypto/aes/asm/aesv8-armx.pl
@@ -72,10 +72,12 @@ my ($zero,$rcon,$mask,$in0,$in1,$tmp,$key)=
$code.=<<___;
.align 5
+.pushsection .text.${prefix}_set_encrypt_key,"ax",%progbits
.Lrcon:
.long 0x01,0x01,0x01,0x01
.long 0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d // rotate-n-splat
.long 0x1b,0x1b,0x1b,0x1b
+.popsection
.globl ${prefix}_set_encrypt_key
.type ${prefix}_set_encrypt_key,%function
diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
index 2617fef7..5fa30059 100644
--- a/crypto/aes/asm/bsaes-armv7.pl
+++ b/crypto/aes/asm/bsaes-armv7.pl
@@ -2049,7 +2049,7 @@ $code.=<<___;
.size bsaes_xts_encrypt,.-bsaes_xts_encrypt
-.globl bsaes_xts_decrypt
+.global_with_section bsaes_xts_decrypt, bsaes_xts_encrypt
.hidden bsaes_xts_decrypt
.type bsaes_xts_decrypt,%function
.align 4