Skip to content

Commit bbe40b9

Browse files
authored
[MCAsmStreamer] Do not crash on switching to sections of unknown types (#92380)
MCObjectStreamer already accepts unknown types.
1 parent c93b45a commit bbe40b9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/MC/MCSectionELF.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
175175
else if (Type == ELF::SHT_LLVM_LTO)
176176
OS << "llvm_lto";
177177
else
178-
report_fatal_error("unsupported type 0x" + Twine::utohexstr(Type) +
179-
" for section " + getName());
178+
OS << "0x" << Twine::utohexstr(Type);
180179

181180
if (EntrySize) {
182181
assert(Flags & ELF::SHF_MERGE);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux-gnu %s -o - \
1+
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux-gnu %s \
22
// RUN: | llvm-readobj -S --symbols - | FileCheck --check-prefix=OBJ %s
33

4-
// RUN: not --crash llvm-mc -filetype=asm -triple=x86_64-pc-linux-gnu %s -o - 2>&1 \
4+
// RUN: llvm-mc -filetype=asm -triple=x86_64-pc-linux-gnu %s \
55
// RUN: | FileCheck --check-prefix=ASM %s
66

77
.section .sec,"a",@0x7fffffff
@@ -11,4 +11,4 @@
1111
// OBJ-NEXT: Type: Unknown (0x7FFFFFFF)
1212
// OBJ: }
1313

14-
// ASM: unsupported type 0x7fffffff for section .sec
14+
// ASM: .section .sec,"a",@0x7fffffff

0 commit comments

Comments
 (0)