[llvm] [MC][ELF] Fix printing group signature symbols. (PR #112543)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 06:36:47 PDT 2024
https://github.com/kosarev updated https://github.com/llvm/llvm-project/pull/112543
>From c9d2e73688b40fa51b9d9f27ddf6827a79b8adc2 Mon Sep 17 00:00:00 2001
From: Ivan Kosarev <ivan.kosarev at amd.com>
Date: Wed, 16 Oct 2024 14:27:18 +0100
Subject: [PATCH] [MC][ELF] Fix printing group signature symbols.
They may be not known.
---
llvm/lib/MC/MCSectionELF.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp
index 25e62b70b5e2a0..3dc9a67e63939a 100644
--- a/llvm/lib/MC/MCSectionELF.cpp
+++ b/llvm/lib/MC/MCSectionELF.cpp
@@ -191,8 +191,10 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
}
if (Flags & ELF::SHF_GROUP) {
- OS << ",";
- printName(OS, Group.getPointer()->getName());
+ if (const MCSymbolELF *Signature = Group.getPointer()) {
+ OS << ",";
+ printName(OS, Signature->getName());
+ }
if (isComdat())
OS << ",comdat";
}
More information about the llvm-commits
mailing list