[all-commits] [llvm/llvm-project] 5798be: Revert D103717 "[InstrProfiling] Make __profd_ unc...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jun 17 23:38:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5798be84580be233e4cf34c08ceec8f79e80502e
      https://github.com/llvm/llvm-project/commit/5798be84580be233e4cf34c08ceec8f79e80502e
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-06-17 (Thu, 17 Jun 2021)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Transforms/PGOProfile/indirect_call_profile.ll

  Log Message:
  -----------
  Revert D103717 "[InstrProfiling] Make __profd_ unconditionally private for ELF"

This reverts commit 76d0747e0807307780ba84cbd7e5c80b20c26bd7.

If a group has `__llvm_prf_vals` due to static value profiler counters
(`NS!=0`), we cannot make `__llvm_prf_data` private, because a prevailing text
section may reference `__llvm_prf_data` and will cause a `relocation refers to a
discarded section` linker error.

Note: while a `__profc_` group is non-prevailing, it may be referenced by a
prevailing text section due to inlining.

```
group section [   66] `.group' [__profc__ZN5clang20EmitClangDeclContextERN4llvm12RecordKeeperERNS0_11raw_ostreamE] contains 4 sections:
   [Index]    Name
   [   67]   __llvm_prf_cnts
   [   68]   __llvm_prf_vals
   [   69]   __llvm_prf_data
   [   70]   .rela__llvm_prf_data
```




More information about the All-commits mailing list