From 4419cd6becf4a0694255f3560ced1a3ff38faad0 Mon Sep 17 00:00:00 2001 From: Boris Korzun Date: Wed, 20 Sep 2023 15:25:42 +0300 Subject: [PATCH] Implib.so: Fix issue with trailing newline in c++filt output --- contrib/Implib.so/implib-gen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/Implib.so/implib-gen.py b/contrib/Implib.so/implib-gen.py index 3bdfa0d416..9d96324afb 100755 --- a/contrib/Implib.so/implib-gen.py +++ b/contrib/Implib.so/implib-gen.py @@ -95,6 +95,8 @@ def collect_syms(f): elif toc is not None: sym = parse_row(words, toc, ["Value"]) name = sym["Name"] + if not name: + continue if name in syms_set: continue syms_set.add(name) @@ -115,6 +117,7 @@ def collect_syms(f): # Also collected demangled names if syms: out, _ = run(["c++filt"], "\n".join((sym["Name"] for sym in syms))) + out = out.rstrip("\n") # Some c++filts append newlines at the end for i, name in enumerate(out.split("\n")): syms[i]["Demangled Name"] = name