Support "memtag_heap" sanitizer.

Memtag_heap adds an ELF note that enables MTE heap tagging in
bionic/scudo. Ignored on non-executables. With diagnostic
(diag:{memtag_heap:true}) enables the SYNC mode, otherwise - ASYNC mode.

Memtag_heap defaults to set (with diag) on cc_test targets, unset
otherwise. Ignored on non MTE-compatible hardware.

Bug: b/135772972
Test: soong tests

Change-Id: I88fd0f159e609e17bd13487749980a1ba02cb91c
This commit is contained in:
Evgenii Stepanov
2020-04-28 15:09:12 -07:00
parent 016370b146
commit 193ac2eb96
5 changed files with 169 additions and 1 deletions

View File

@@ -236,6 +236,10 @@ func (test *testDecorator) gtest() bool {
return BoolDefault(test.Properties.Gtest, true)
}
func (test *testDecorator) testBinary() bool {
return true
}
func (test *testDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
if !test.gtest() {
return flags