[PATCH] D105916: [AsmPrinter][CallGraphSection] Emit call graph section

Necip Fazil Yildiran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 13:18:36 PDT 2021


necipfazil added inline comments.


================
Comment at: llvm/lib/MC/MCObjectFileInfo.cpp:1046
+                            GroupName, true, ElfSec.getUniqueID(),
+                            cast<MCSymbolELF>(FunctionSym));
+}
----------------
MaskRay wrote:
> getStackSizesSection uses getBeginSYmbol on TextSec.
Could you please provide more information on the requested change?

When the section is linked to `getBeginSymbol(TextSec)` (i.e., `getBeginSymbol(TextSec)` is passed as the last argument to `getELFSection()` call), we still experience issues with garbage collection:

```
`.text.FUNCNAME' referenced in section `.callgraph' of OBJFILE.o: defined in discarded section
```

Therefore, I am passing function symbol as parameter to `getCallGraphSection()` so that we can link the newly created section to it.

Where else do we need to use `getBeginSymbol()`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105916



More information about the llvm-commits mailing list