Skip to content

Commit 7b07595

Browse files
Backport the bugfix for debug symbols generator (ubuntu#284)
1 parent f10095d commit 7b07595

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/strip_binaries.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def read_elf_type(filepath):
4141
for note in sect.iter_notes():
4242
if note['n_type'] == 'NT_GNU_BUILD_ID':
4343
buildId = note['n_desc']
44+
# Sometimes, ELFtools return a bytes array instead of a string.
45+
# This fixes it.
46+
# https://github.com/eliben/pyelftools/issues/188
47+
if isinstance(buildId, bytes):
48+
buildId = buildId.hex()
4449
break
4550
except:
4651
return None, None

0 commit comments

Comments
 (0)