summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_init.cc
AgeCommit message (Collapse)Author
2017-09-21[ubsan] Split ubsan_init_standaloneVitaly Buka
Summary: On Linux we may need preinit_array in static lib and ubsan_standalone_initializer in shared lib. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Save binary name before parsing optionsVitaly Buka
Summary: To parser "include" we may need to do binary name substitution. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11Revert "[ubsan] Save binary name before parsing options"Vitaly Buka
Patch was corrupted by rebase. This reverts commit r312933 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Save binary name before parsing optionsVitaly Buka
Summary: To parser "include" we may need to do binary name substitution. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14[ubsan] Use the correct tool name in diagnosticsVedant Kumar
When using ASan and UBSan together, the common sanitizer tool name is set to "AddressSanitizer". That means that when a UBSan diagnostic is printed out, it looks like this: SUMMARY: AddressSanitizer: ... This can confuse users. Fix it so that we always use the correct tool name when printing out UBSan diagnostics. Differential Revision: https://reviews.llvm.org/D32066 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15[ubsan] Initialize Android logging.Evgeniy Stepanov
This adds standalone ubsan output to "adb logcat", the same as ASan does. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278706 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04[ASan] Make binary name reader cross-platform.Yury Gribov
Differential Revision: http://reviews.llvm.org/D10213 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-19Make ubsan respect log_pathHal Finkel
As with the other sanitizers, it is desirable to allow ubsan's output to be redirected to somewhere other than stderr (and into per-process log files). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@235277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01[UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov
Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26[UBSan] Explicitly list all supported OS/arch pairs supported by UBSan.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20[Sanitizer] Refactor SuppressionContext class.Alexey Samsonov
SuppressionContext is no longer a singleton, shared by all sanitizers, but a regular class. Each of ASan, LSan, UBSan and TSan now have their own SuppressionContext, which only parses suppressions specific to that sanitizer. "suppressions" flag is moved away from common flags into tool-specific flags, so the user now may pass ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt in a single invocation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230026 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Flag parser rewrite.Evgeniy Stepanov
The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06[ubsan] partially enable -fsanitize-coverage=N with ubsan. It will work as ↵Kostya Serebryany
usual in most cases but will not dump coverage on error with -fno-sanitize-recover (that'll be a separate fix) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225234 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12Revert r217616. Problems and complexity it introduces negate its benefitAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217652 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11[UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even ifAlexey Samsonov
UBSan is combined with ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10[Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().Alexey Samsonov
We may as well just use Symbolizer::GetOrInit() in all the cases. Don't call Symbolizer::Get() early in tools initialization: these days it doesn't do any important setup work, and we may as well create the symbolizer the first time it's actually needed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05[UBSan] Allow to suppress reports from vptr checker for specified types.Alexey Samsonov
Based on http://reviews.llvm.org/D4702 by Byoungyoung Lee! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29[UBSan] Move all runtime flags parsing to ubsan_flags.cc.Alexey Samsonov
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214258 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-26[UBSan] Initialize symbolizer inside __ubsan::Init().Alexey Samsonov
We used to initialize symbolizer lazily, but this doesn't work in various sandboxed environments. Instead, let's be consistent with the rest of sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214006 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25[UBSan] Call UBSan initialization as early as possible.Alexey Samsonov
Specifically, use .preinit_array initialization on Linux and dynamic global initializer on another platforms. Historically UBSan didn't have any initialization code and its runtime was stateless. This is no longer the case - UBSan relies on some non-trivial functionality from sanitizer_common (e.g. online symbolization) and is now configurable by runtime flags. Additionally, we've dropped support for enabling UBSan only for a few shared objects, so UBSan is now always linked into the main executable, so now we can use similar initialization as all the rest sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213983 91177308-0d34-0410-b5e6-96231b3b80d8