[sanitizer] Add early call handling to strchr + strrchr interceptors
authorDerek Bruening <bruening@google.com>
Wed, 27 Apr 2016 21:20:46 +0000 (21:20 +0000)
committerDerek Bruening <bruening@google.com>
Wed, 27 Apr 2016 21:20:46 +0000 (21:20 +0000)
commit41939466d1a5677412891f8d3370c2689e7f759d
tree45544e38b09082ad36f9d6e6481c1b8b6b68463e
parentaf5aebaa3246a404644a66d4b8e5844ead30aef8
[sanitizer] Add early call handling to strchr + strrchr interceptors

Summary:
The strchr and strrchr interceptors are sometimes invoked too early
for their REAL() counterparts to be initialized.  We have seen this in
hooks invoked from tcmalloc on the dlsym() used in initializing
interceptors.  A special check is added to use internal_ routines for
this situation.

Reviewers: vitalybuka, aizatsky, filcab

Subscribers: filcab, llvm-commits, eugenis, kcc, zhaoqin, aizatsky, kubabrecka

Differential Revision: http://reviews.llvm.org/D19607

llvm-svn: 267793
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc