diff options
author | Fangrui Song <i@maskray.me> | 2021-03-03 11:32:24 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-03-03 11:32:24 -0800 |
commit | a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca (patch) | |
tree | 8e6b6e034e4e1df11f6cdb0c3b194d3ea561bd02 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | |
parent | 75df61e93d22c5225469142bf79592bce4ffb3de (diff) | |
download | llvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.zip llvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.tar.gz llvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.tar.bz2 |
[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` (LLD 13 (D96914); GNU ld 2.37 https://sourceware.org/bugzilla/show_bug.cgi?id=27451),
the linker does not let `__start_/__stop_` references retain their sections.
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 COFF/Mach-O are not affected.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D97649
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions