[PATCH] D104060: Machine IR Profile

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 20:49:10 PDT 2021


ellis added a comment.

In D104060#2831660 <https://reviews.llvm.org/D104060#2831660>, @MaskRay wrote:

> In D104060#2831605 <https://reviews.llvm.org/D104060#2831605>, @ellis wrote:
>
>> `__llvm_mipmap` section should have type `ELF::SHF_NOTE` so that it doesn't get stripped by `--gc-sections`.
>
> This is an abuse of the section type `SHF_NOTE`. GNU ld retaining allocable SHF_NOTE sections under `--gc-sections` is a somewhat unfortunate fact. I feel it is inappropriate and I know a FreeBSD folk who doesn't like this rule.

I found that `SHF_GNU_RETAIN` was not enough, but I'm happy to explore other ways if `SHF_NOTE` is not preferred.

> A metadata section design making GC work under all of the 3 major binary formats (ELF/PE-COFF/Mach-O) is very complex. You may dig some history related to `__llvm_prf_*` and `__prof*`. That may be another argument that we should probably focus on one format. After D104556 <https://reviews.llvm.org/D104556> and a follow-up patch making the function address relative, I think `__llvm_prf_*` will be in a very good state.

Thanks, I'll take a look at `__llvm_prf_*` and friends.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104060



More information about the llvm-commits mailing list