[asan] Stop instrumenting user-defined ELF sections
authorMichał Górny <mgorny@moritz.systems>
Sat, 3 Oct 2020 14:38:09 +0000 (16:38 +0200)
committerMichał Górny <mgorny@moritz.systems>
Sat, 3 Oct 2020 17:54:38 +0000 (19:54 +0200)
commit66e493f81e8e27b4a498a6dac54d404c2333fa5e
tree0bd9525859f3af2662b26439e1343657b3330a0e
parent53fc426088d7e48272bfc37a3881a7a6fe405940
[asan] Stop instrumenting user-defined ELF sections

Do not instrument user-defined ELF sections (whose names resemble valid
C identifiers).  They may have special use semantics and modifying them
may break programs.  This is e.g. the case with NetBSD __link_set API
that expects these sections to store consecutive array elements.

Differential Revision: https://reviews.llvm.org/D76665
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-netbsd-link_set.ll [new file with mode: 0644]
llvm/test/Instrumentation/AddressSanitizer/instrument-section-invalid-c-ident.ll [new file with mode: 0644]