[clang] [llvm] [clang-tools-extra] Add STACK_SIZES section for MachOS. (PR #77106)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 11:27:03 PST 2024


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

>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 1/2] 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.

>From 2822300c40c9849b8c67d6fb5cbcb407ef3ffe17 Mon Sep 17 00:00:00 2001
From: shami <shami_thoke at yahoo.com>
Date: Fri, 5 Jan 2024 22:10:24 +0530
Subject: [PATCH 2/2] clang format.

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

diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index c7932be7e8680e..a069e07bf52281 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -316,8 +316,8 @@ 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());
+  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



More information about the cfe-commits mailing list