From 6b5f472a8e3a3850932e558340cab23e7de07cdb Mon Sep 17 00:00:00 2001 From: jianliang00 Date: Mon, 17 Nov 2025 19:32:43 +0800 Subject: [PATCH] Ignore the 'B' augmentation character when reading CIE info. Some compilers emit a B augmentation character, which triggers a fatal error. Since this augmentation isn't useful for size analysis, we simply ignore it. Fixes: #450 --- src/eh_frame.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/eh_frame.cc b/src/eh_frame.cc index 93282e2..be3281b 100644 --- a/src/eh_frame.cc +++ b/src/eh_frame.cc @@ -189,8 +189,16 @@ void ReadEhFrame(string_view data, RangeSink* sink) { ReadEncodedPointer(encoding, true, &entry, nullptr, sink); break; } + case 'G': + case 'B': { + // Some compilers emit a G/B augmentation character. We don't + // currently handle it, but it's not a fatal error. + // ref: https://github.com/llvm-mirror/libunwind/commit/0930d6cee2caf71685a84b648f85a2f80bc182c4 + break; + } default: - THROW("Unexepcted augmentation character"); + std::string aug_char(1, aug_string[0]); + THROWF("Unexepcted augmentation character: $0", aug_char); } aug_string.remove_prefix(1); }