[HWASan] Add sizeof(global) in report even if symbols missing.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Tue, 9 Jun 2020 18:57:24 +0000 (11:57 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Tue, 9 Jun 2020 20:02:13 +0000 (13:02 -0700)
commite26b25f8b1fdbc088abdfab933d909960989c64b
tree97db8f1a235606ca2c8fd97e5b187d342cc87345
parent9bca45bd45ebb0abb676bcdce2a8436396203460
[HWASan] Add sizeof(global) in report even if symbols missing.

Summary: Refactor the current global header iteration to be callback-based, and add a feature that reports the size of the global variable during reporting. This allows binaries without symbols to still report the size of the global variable, which is always available in the HWASan globals PT_NOTE metadata.

Reviewers: eugenis, pcc

Reviewed By: pcc

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D80599
compiler-rt/lib/hwasan/CMakeLists.txt
compiler-rt/lib/hwasan/hwasan.cpp
compiler-rt/lib/hwasan/hwasan_globals.cpp [new file with mode: 0644]
compiler-rt/lib/hwasan/hwasan_globals.h [new file with mode: 0644]
compiler-rt/lib/hwasan/hwasan_report.cpp
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/test/hwasan/TestCases/global.c
llvm/utils/gn/build/libs/pthread/BUILD.gn
llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn