[PATCH] D76802: [InstrProfiling] Use !associated metadata for counters, data and values

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 17:05:35 PDT 2020


phosek added a comment.

In D76802#2086875 <https://reviews.llvm.org/D76802#2086875>, @phosek wrote:

> In D76802#2086757 <https://reviews.llvm.org/D76802#2086757>, @vitalybuka wrote:
>
> > I still can reproduce with the latest patch on my workstation
> >
> >   Exit Code: 1
> >  
> >   Command Output (stderr):
> >   --
> >   /usr/bin/ld: __llvm_prf_data has both ordered and unordered sections
> >   /usr/bin/ld: final link failed: bad value
> >   clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
> >
>
>
> This is the other issue I mentioned which also affects Chromium bots. The root cause is the lack of support for the extended semantics of `SHF_LINK_ORDER` that `!associated` metadata rely on in bfd.ld. I'm trying to figure out what's the best way forward. We could just disable all affected profile tests when bfd.ld is used as the linker, but that's pretty drastic. Another option would be to gate this feature on a backend flag; targets that use gold or lld as their linker could turn this on by default.


I've found a workaround for the bfd.ld issue. The problem is that `__llvm_prf_data` input sections have `sh_addralign`=8 but size is 4mod8.  bfd.ld is considering the alignment padding insertions to be "unordered sections" in the input. Inserting artificial padding in the `__llvm_prf_data` input section seems to work around the issue. @vitalybuka can you test this locally on your machine please?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76802/new/

https://reviews.llvm.org/D76802





More information about the llvm-commits mailing list