[PATCH] D124855: [XCOFF][AIX] Use unique section names for LSDA and EH info sections with -ffunction-sections

Xing Xue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 12:57:51 PDT 2022


xingxue added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h:291
+  /// For functions, this will return the LSDA section. If option
+  /// -ffunction-sections is on, this will return a unique cscet with the
+  /// function name appended to .gcc_except_table as a suffix of the LSDA
----------------
hubert.reinterpretcast wrote:
> Fix typo.
Fixed, thanks!


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AIXException.cpp:43
+      cast<MCSectionXCOFF>(Asm->getObjFileLowering().getCompactUnwindSection());
+  if (Asm->TM.getFunctionSections()) {
+    // If option -ffunction-section is on, append the function name to the
----------------
hubert.reinterpretcast wrote:
> Should we also try to use the explicit section name if the function has one?
I am inclined to use the function name because this is consistent with the behavior on Linux.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AIXException.cpp:44
+  if (Asm->TM.getFunctionSections()) {
+    // If option -ffunction-section is on, append the function name to the
+    // name of EH Info Table csect so that each function has its own EH Info
----------------
hubert.reinterpretcast wrote:
> Fix option name.
Fixed, thanks!


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AIXException.cpp:53
+  }
+  Asm->OutStreamer->SwitchSection(cast<MCSection>(EHInfo));
   MCSymbol *EHInfoLabel =
----------------
hubert.reinterpretcast wrote:
> I think the cast is not necessary.
Removed the unnecessary `cast`, thanks! 


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2571
+  auto *LSDA = cast<MCSectionXCOFF>(LSDASection);
+  if (TM.getFunctionSections()) {
+    // If option -ffunction-section is on, append the function name to the
----------------
hubert.reinterpretcast wrote:
> Should we also try to use the explicit section name if the function has one?
I am inclined to use the function name because this is consistent with the behavior on Linux.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124855



More information about the llvm-commits mailing list