llvm-project/llvm/test/Instrumentation
Fangrui Song 04c3040f41 [InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF
`__llvm_prf_vnodes` and `__llvm_prf_names` are used by runtime but not
referenced via relocation in the translation unit.

With `-z start-stop-gc` (D96914 https://sourceware.org/bugzilla/show_bug.cgi?id=27451),
the linker no longer lets `__start_/__stop_` references retain them.

Place `__llvm_prf_vnodes` and `__llvm_prf_names` in `llvm.used` to make
them retained by the linker.

This patch changes most existing `UsedVars` cases to `CompilerUsedVars`
to reflect the ideal state - if the binary format properly supports
section based GC (dead stripping), `llvm.compiler.used` should be sufficient.

`__llvm_prf_vnodes` and `__llvm_prf_names` are switched to `UsedVars`
since we want them to be unconditionally retained by both compiler and linker.

Behaviors on other COFF/Mach-O are not affected.

Differential Revision: https://reviews.llvm.org/D97649
2021-03-01 13:43:23 -08:00
..
AddressSanitizer [asan] Avoid putting globals in a comdat section when targetting elf. 2021-02-24 12:01:56 +00:00
BoundsChecking OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
DataFlowSanitizer [dfsan] Record dfsan metadata in globals 2021-02-26 14:42:46 -08:00
HWAddressSanitizer [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
HeapProfiler [MemProf] Fix a potential "permission denied" test failure on some systems. 2020-12-07 14:04:23 +01:00
InstrOrderFile
InstrProfiling [InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF 2021-03-01 13:43:23 -08:00
MemorySanitizer [msan] Set cmpxchg shadow precisely 2021-02-19 20:23:23 +00:00
PoisonChecking
SanitizerCoverage [SanitizerCoverage] Clarify llvm.used/llvm.compiler.used and partially fix unmatched metadata sections on Windows 2021-02-26 11:10:03 -08:00
ThreadSanitizer [test][TSan] Fix tests under NPM 2020-09-18 11:37:55 -07:00
cgprofile.ll [CGProfile] don't emit cgprofile entry if called function is dllimport 2020-09-23 16:56:54 -07:00