[llvm] Add STACK_SIZES section for MachOS. (PR #77106)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 07:17:45 PST 2024


https://github.com/shamithoke created https://github.com/llvm/llvm-project/pull/77106

None

>From e939dbedfa4cd875858825e890310d2581bfa525 Mon Sep 17 00:00:00 2001
From: shami <shami_thoke at yahoo.com>
Date: Thu, 28 Dec 2023 21:19:36 +0530
Subject: [PATCH] Add STACK_SIZES section for MachOS.

---
 llvm/lib/MC/MCObjectFileInfo.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index a79759557b2e3d..c7932be7e8680e 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -316,6 +316,9 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
   RemarksSection = Ctx->getMachOSection(
       "__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata());
 
+  StackSizesSection = Ctx->getMachOSection("__STACK_SIZES", "__stack_sizes",
+                                           0, SectionKind::getData());
+
   // The architecture of dsymutil makes it very difficult to copy the Swift
   // reflection metadata sections into the __TEXT segment, so dsymutil creates
   // these sections in the __DWARF segment instead.



More information about the llvm-commits mailing list