summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_rtl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tsan/rtl/tsan_rtl.cc')
-rw-r--r--lib/tsan/rtl/tsan_rtl.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc
index df41f188..36fe5787 100644
--- a/lib/tsan/rtl/tsan_rtl.cc
+++ b/lib/tsan/rtl/tsan_rtl.cc
@@ -457,6 +457,16 @@ void MemoryAccess(ThreadState *thr, uptr pc, uptr addr,
}
#endif
+ if (*shadow_mem == kShadowRodata) {
+ // Access to .rodata section, no races here.
+ // Measurements show that it can be 10-20% of all memory accesses.
+ StatInc(thr, StatMop);
+ StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead);
+ StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog));
+ StatInc(thr, StatMopRodata);
+ return;
+ }
+
FastState fast_state = thr->fast_state;
if (fast_state.GetIgnoreBit())
return;