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

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 08:35:56 PDT 2022


hubert.reinterpretcast accepted this revision.
hubert.reinterpretcast added a comment.
This revision is now accepted and ready to land.

LGTM; however, might want to wait a bit to see if other reviewers have comments.



================
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
----------------
xingxue wrote:
> 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.
Yes, it does seem that the explicit section name is not used by Linux (with and without `-ffunction-sections`).


================
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
----------------
xingxue wrote:
> 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.
Yes, it does seem that the explicit section name is not used by Linux (with and without `-ffunction-sections`).


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