[PATCH] D153189: [MC] Make .pseudo_probe GC-able

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 23:15:34 PDT 2023


MaskRay marked 2 inline comments as done.
MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCObjectFileInfo.cpp:1180
+  return Ctx->getELFSection(PseudoProbeSection->getName(), ELF::SHT_PROGBITS,
+                            Flags, 0, GroupName, true, ElfSec.getUniqueID(),
+                            cast<MCSymbolELF>(TextSec.getBeginSymbol()));
----------------
hoy wrote:
> MaskRay wrote:
> > hoy wrote:
> > > Should the pseudo probe section be a comdat only if the text section is a comdat? 
> > The `const MCSymbol *Group = ElfSec.getGroup()` condition ensures that the `.pseudo_probe` section is in a section group only when the text section is in a section group. When `GroupName` is empty, `getELFSection` does not use a section group.
> So IIUC, when `GroupName` is empty, `IsComdat=true` doesn't really make a difference right?
Right. ELF has the concept of section groups. `GRP_COMDAT` is a special/mostly common section group.

Actually, in our use cases `IsComdat` is a no-op. We always create text sections before these metadata sections. If the text section has created a section group with the `GRP_COMDAT` flag, new `getELFSection` calls, whether or not `IsComdat`, does not change the fact.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153189



More information about the llvm-commits mailing list