boringssl/crypto
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
..
asn1 Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
base64 Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
bio Always push errors on BIO_read_asn1 failure. 2018-10-11 19:53:15 +00:00
bn_extra Replace BIO_new + BIO_set_fp with BIO_new_fp. 2018-09-26 17:21:08 +00:00
buf Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
bytestring Speculatively remove __STDC_*_MACROS. 2018-11-14 16:14:37 +00:00
chacha Support execute-only memory for AArch64 assembly. 2018-11-19 19:58:15 +00:00
cipher_extra Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
cmac Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
conf Use proper functions for lh_*. 2018-10-15 23:37:04 +00:00
curve25519 Automatically disable assembly with MSAN. 2018-09-07 21:12:37 +00:00
dh Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
digest_extra Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
dsa Tidy up dsa_sign_setup. 2018-10-25 21:51:57 +00:00
ec_extra Use EC_RAW_POINT in ECDSA. 2018-11-13 02:06:46 +00:00
ecdh_extra Clean up EC_POINT to byte conversions. 2018-11-13 17:27:59 +00:00
ecdsa_extra Remove unreachable code. 2018-11-12 23:34:36 +00:00
engine Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
err Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
evp Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
fipsmodule Support execute-only memory for AArch64 assembly. 2018-11-19 19:58:15 +00:00
hkdf Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
hmac_extra Convert a number of tests to GTest. 2017-06-01 17:02:13 +00:00
lhash Fix undefined function pointer casts in LHASH. 2018-10-15 23:53:24 +00:00
obj Speculatively remove __STDC_*_MACROS. 2018-11-14 16:14:37 +00:00
pem Rewrite PEM_X509_INFO_read_bio. 2018-10-01 17:35:10 +00:00
perlasm Support execute-only memory for AArch64 assembly. 2018-11-19 19:58:15 +00:00
pkcs7 Fix undefined function pointer casts in {d2i,i2d}_Foo_{bio,fp} 2018-10-01 17:34:53 +00:00
pkcs8 Fix undefined function pointer casts in {d2i,i2d}_Foo_{bio,fp} 2018-10-01 17:34:53 +00:00
poly1305 Automatically disable assembly with MSAN. 2018-09-07 21:12:37 +00:00
pool Use proper functions for lh_*. 2018-10-15 23:37:04 +00:00
rand_extra [rand] Disable RandTest.Fork on Fuchsia 2018-10-16 18:57:29 +00:00
rc4 Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
rsa_extra Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
stack Test the binary search more aggressively. 2018-10-02 00:02:19 +00:00
test Print a message when simulating CPUs. 2018-11-16 23:12:27 +00:00
x509 Always push errors on BIO_read_asn1 failure. 2018-10-11 19:53:15 +00:00
x509v3 Fix undefined function pointer casts in {d2i,i2d}_Foo_{bio,fp} 2018-10-01 17:34:53 +00:00
CMakeLists.txt Add a test for STACK_OF(T). 2018-09-26 23:28:50 +00:00
compiler_test.cc
constant_time_test.cc
cpu-aarch64-fuchsia.c
cpu-aarch64-linux.c
cpu-arm-linux_test.cc Fix GCC (8.2.1) build error. 2018-09-06 15:38:11 +00:00
cpu-arm-linux.c
cpu-arm-linux.h
cpu-arm.c
cpu-intel.c Speculatively remove __STDC_*_MACROS. 2018-11-14 16:14:37 +00:00
cpu-ppc64le.c
crypto.c Simulate other ARM CPUs when running tests. 2018-11-15 00:58:09 +00:00
ex_data.c
internal.h Simulate other ARM CPUs when running tests. 2018-11-15 00:58:09 +00:00
mem.c Use sdallocx, if available, when deallocating. 2018-09-17 21:02:59 +00:00
refcount_c11.c
refcount_lock.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
refcount_test.cc Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
self_test.cc
thread_none.c Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
thread_pthread.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
thread_test.cc Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
thread_win.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
thread.c