[PATCH] D96837: Add !retain metadata to represent SHF_GNU_RETAIN on ELF platforms

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 00:49:04 PST 2021


MaskRay added a comment.

In D96837#2567702 <https://reviews.llvm.org/D96837#2567702>, @phosek wrote:

> Have you considered using `llvm.used` instead of introducing new metadata type? `__attribute__((used))` is lowered to `llvm.used` so this should be equivalent.

I have considered it. It is true that clang places`__attribute__((used))` definitions in `llvm.uses`, but it adds a bunch of other stuff (I am reading the call sites of `addUsedGlobal` to figure out what I may have missed in D96838 <https://reviews.llvm.org/D96838>).
Second, I am concerned that the separate section semantics (copied from GCC) may not be desired for some llvm.uses use cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96837



More information about the llvm-commits mailing list