[PATCH] D79590: [lld] Add a new output section ".text.unknown" for funtions with unknown hotness info especially in sampleFDO

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 13:35:46 PDT 2020


tmsriram added inline comments.


================
Comment at: lld/ELF/Writer.cpp:136
     for (StringRef v :
-         {".text.hot.", ".text.unlikely.", ".text.startup.", ".text.exit."})
+         {".text.hot.", ".text.unknown.", ".text.unlikely.", ".text.startup.", ".text.exit."})
       if (isSectionPrefix(v, s->name))
----------------
wmi wrote:
> tmsriram wrote:
> > The new prefix looks good to me.
> > 
> > Just curious about input sections that are named just ".text.hot" or ".text.unknown" without the traling period.  This could happen with -fno-unique-section-names I think?  In that case, this handling seems insufficient.  This is related to -keep-text-section-prefix in general. I can take a look at this.
> isSectionPrefix seems considering the section name without trailing period (prefix.drop_back())?
> 
> ```
> static bool isSectionPrefix(StringRef prefix, StringRef name) {
>   return name.startswith(prefix) || name == prefix.drop_back();
> }
> ```
Ah, thanks!


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D79590





More information about the llvm-commits mailing list