Skip to content

Commit fa97d6e

Browse files
Merge pull request #5795 from rastogishubham/91990418
Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.
2 parents e931639 + 1c853a6 commit fa97d6e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

llvm/lib/MC/MCDwarf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
18621862

18631863
// Emit the compact unwind info if available.
18641864
bool NeedsEHFrameSection = !MOFI->getSupportsCompactUnwindWithoutEHFrame();
1865-
if (IsEH && MOFI->getCompactUnwindSection()) {
1865+
if (MOFI->getCompactUnwindSection()) {
18661866
Streamer.generateCompactUnwindEncodings(MAB);
18671867
bool SectionEmitted = false;
18681868
for (const MCDwarfFrameInfo &Frame : FrameArray) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# RUN: llvm-mc -filetype=obj --triple=arm64-apple-darwin22.1.0 %s -o %t.o
2+
# RUN: llvm-dwarfdump -debug-frame %t.o | FileCheck %s
3+
4+
# CHECK: .debug_frame contents:
5+
# CHECK-EMPTY:
6+
# CHECK-NEXT: 00000000 00000014 ffffffff CIE
7+
# CHECK: .eh_frame contents:
8+
# CHECK-EMPTY:
9+
10+
.cfi_startproc
11+
.cfi_signal_frame
12+
.cfi_def_cfa x28, 0x340
13+
.cfi_endproc
14+
.cfi_sections .debug_frame

0 commit comments

Comments
 (0)