boringssl/util
David Benjamin 4dcc290eb0 Fix GOTPCREL accesses to symbols defined outside the module.
5c38c05b26 caused foo@GOTPCREL for
external foo to resolve to bcm_redirector_foo. This is morally
equivalent to using foo@PLT when a pointer to foo is needed. But this
does not work if foo is data. Notably, this ended up mangling
OPENSSL_ia32cap_P because it failed to recognize it as an symbol in the
library (but external to the module). It also mangles some things that
ASan emits.

(It also breaks non-NULL function pointer comparisons, but those are
silly.)

Instead, apply a variation of the OPENSSL_ia32cap_addr_delta trick that
works for the GOT. "addr_delta" is really weird, so I'm calling this an
"external relocation". This causes fprintf(stderr) to work and also
seems to keep ASan compiling. I was unable to reproduce the case that
5c38c05b26 added the bcm_redirector_foo
transform for.

Also tighten up the pattern. No need to reference a bit of memory twice
since we just loaded it into a register.

Change-Id: If5520fc0887e83e23a08828e40fbbed9e47d912e
Reviewed-on: https://boringssl-review.googlesource.com/16345
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-05-15 23:33:15 +00:00
..
bot Add hash of SDE tool for the bots. 2017-05-11 20:10:33 +00:00
fipstools Fix GOTPCREL accesses to symbols defined outside the module. 2017-05-15 23:33:15 +00:00
32-bit-toolchain.cmake
all_tests.go Add a flag to configure the path to the SDE executable. 2017-05-10 21:56:38 +00:00
all_tests.json Move cipher/ into crypto/fipsmodule/ 2017-05-05 22:39:40 +00:00
BUILD.toplevel Emit ssl_[c|cc]_sources for Bazel. 2017-01-23 21:36:37 +00:00
diff_asm.go Fix diff_asm.go and revert another local MASM perlasm change. 2017-05-11 23:30:01 +00:00
doc.config Unexport time_support.h. 2017-02-17 21:41:56 +00:00
doc.css
doc.go Remove BN_FLG_CONSTTIME. 2017-01-12 02:00:44 +00:00
generate_build_files.py generate_build_files: omit tests from fips_fragments. 2017-05-08 23:49:44 +00:00
generate-asm-lcov.py
generate-coverage.sh Fix generate-coverage.sh. 2017-03-21 14:54:47 +00:00
make_errors.go Fix make_errors.go. 2017-05-03 20:02:21 +00:00
run_android_tests.go Add missing files to run_android_test.go. 2017-04-06 15:54:06 +00:00