[SanitizerCoverage] Add associated metadata to PC guards.
authorMatt Morehouse <mascasa@google.com>
Tue, 14 Aug 2018 22:04:34 +0000 (22:04 +0000)
committerMatt Morehouse <mascasa@google.com>
Tue, 14 Aug 2018 22:04:34 +0000 (22:04 +0000)
commit0f22fac2742bd3e382bba577671c19841ac2b5f7
treeec02544706d7b556cca539554efe29b08fd14146
parentcd4056c8810c1336d6059e1338b7af9400a141d5
[SanitizerCoverage] Add associated metadata to PC guards.

Summary:
Without this metadata LLD strips unused PC table entries
but won't strip unused guards.  This metadata also seems
to influence the linker to change the ordering in the PC
guard section to match that of the PC table section.

The libFuzzer runtime library depends on the ordering
of the PC table and PC guard sections being the same.  This
is not generally guaranteed, so we may need to redesign
PC tables/guards/counters in the future.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: kcc, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D50483

llvm-svn: 339733
compiler-rt/test/fuzzer/gc-sections.test
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp