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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 14:33:28 PST 2021


MaskRay added a comment.

Looks quite good.

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

> @MaskRay does this look good to you?

Looks like GNU ld has an infinite loop problem w.r.t self-link SHF_LINK_ORDER: https://sourceware.org/bugzilla/show_bug.cgi?id=27259

> The reason is that the C identifier sections are considered as GC roots. Adding SHF_LINK_ORDER is a trick to defeat the GC root semantics.

Hope GNU ld can implement the rule. For now, only `-fbinutils-version=none` can use this.

About `counter-associated-metadata`: perhaps we should just call it `linkorder-counter`. `!associated` while being metadata, is actually similar to `, comdat` (it cannot be freely dropped) and its semantics is tightly coupled with `SHF_LINK_ORDER`. linkorder conveys more information than `associated` (`associated` can mean many things).


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