From 5b61b9ebc5ad0e25475f2aa633d3a6592dd65ba1 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Thu, 24 Sep 2015 19:18:53 -0700 Subject: [PATCH] Update ChaCha20 ARM asm with sections. The ChaCha20 ARM asm is generated from GCC. This change updates the GCC command line to include -ffunction-sections, which causes GCC to put each function in its own section so that the linker with --gc-sections can trim unused functions. Since the file only has a single function, this is a bit useless, but it'll now be consistent with the other ARM asm. Change-Id: If12c675700310ea55af817b5433844eeffc9d029 Reviewed-on: https://boringssl-review.googlesource.com/6006 Reviewed-by: Adam Langley --- crypto/chacha/chacha_vec_arm.S | 4 ++-- crypto/chacha/chacha_vec_arm_generate.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/chacha/chacha_vec_arm.S b/crypto/chacha/chacha_vec_arm.S index 0f826279..e1ec46ef 100644 --- a/crypto/chacha/chacha_vec_arm.S +++ b/crypto/chacha/chacha_vec_arm.S @@ -20,7 +20,7 @@ # This file was generated by chacha_vec_arm_generate.go using the following # compiler command: # -# /opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -O3 -mcpu=cortex-a8 -mfpu=neon -fpic -DASM_GEN -I ../../include -S chacha_vec.c -o - +# /opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -O3 -mcpu=cortex-a8 -mfpu=neon -fpic -ffunction-sections -DASM_GEN -I ../../include -S chacha_vec.c -o - #if !defined(OPENSSL_NO_ASM) #if defined(__arm__) || defined(__aarch64__) @@ -52,7 +52,7 @@ .eabi_attribute 18, 4 .thumb .file "chacha_vec.c" - .text + .section .text.CRYPTO_chacha_20_neon,"ax",%progbits .align 2 .global CRYPTO_chacha_20_neon .hidden CRYPTO_chacha_20_neon diff --git a/crypto/chacha/chacha_vec_arm_generate.go b/crypto/chacha/chacha_vec_arm_generate.go index 6d167b9a..1e185e57 100644 --- a/crypto/chacha/chacha_vec_arm_generate.go +++ b/crypto/chacha/chacha_vec_arm_generate.go @@ -36,6 +36,7 @@ func main() { "-mcpu=cortex-a8", "-mfpu=neon", "-fpic", + "-ffunction-sections", "-DASM_GEN", "-I", "../../include", "-S", "chacha_vec.c",