boringssl/crypto/fipsmodule/sha/asm
David Benjamin 293d9ee4e8 Support execute-only memory for AArch64 assembly.
Put data in .rodata and, rather than adr, use the combination of adrp :pg_hi21:
and add :lo12:. Unfortunately, iOS uses different syntax, so we must add more
transforms to arm-xlate.pl.

Tested manually by:

1. Use Android NDK r19-beta1

2. Follow usual instructions to configure CMake for aarch64, but pass
   -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -Wl,-execute-only".

3. Build. Confirm with readelf -l tool/bssl that .text is not marked
   readable.

4. Push the test binaries onto a Pixel 3. Test normally and with
   --cpu={none,neon,crypto}. I had to pass --gtest_filter=-*Thread* to
   crypto_test. There appears to be an issue with some runtime function
   that's unrelated to our assembly.

No measurable performance difference.

Going forward, to support this, we will need to apply similar changes to
all other AArch64 assembly. This is relatively straightforward, but may
be a little finicky for dual-AArch32/AArch64 files (aesv8-armx.pl).

Update-Note: Assembly syntax is a mess. There's a decent chance some
assembler will get offend.

Change-Id: Ib59b921d4cce76584320fefd23e6bb7ebd4847eb
Reviewed-on: https://boringssl-review.googlesource.com/c/33245
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
2018-11-19 19:58:15 +00:00
..
sha1-586.pl Sync up some perlasm license headers and easy fixes. 2018-02-11 01:00:35 +00:00
sha1-armv4-large.pl Revert assembly changes in "Hide CPU capability symbols in C." 2017-10-30 20:39:57 +00:00
sha1-armv8.pl Support execute-only memory for AArch64 assembly. 2018-11-19 19:58:15 +00:00
sha1-x86_64.pl Update several assembly files from upstream. 2018-08-07 18:57:17 +00:00
sha256-586.pl Sync up some perlasm license headers and easy fixes. 2018-02-11 01:00:35 +00:00
sha256-armv4.pl Silence ARMv8 deprecated IT instruction warnings. 2017-12-14 01:56:22 +00:00
sha512-586.pl Sync up some perlasm license headers and easy fixes. 2018-02-11 01:00:35 +00:00
sha512-armv4.pl Silence ARMv8 deprecated IT instruction warnings. 2017-12-14 01:56:22 +00:00
sha512-armv8.pl Support execute-only memory for AArch64 assembly. 2018-11-19 19:58:15 +00:00
sha512-x86_64.pl Update several assembly files from upstream. 2018-08-07 18:57:17 +00:00