Skip to content

Commit

Permalink
Check for invalid symbol names in llvm-nm output.
Browse files Browse the repository at this point in the history
See #12551
and:
#17826

Older versions of llvm didn't used to mangle these __invoke symbols.
  • Loading branch information
sbc100 committed Sep 19, 2022
1 parent c7416fd commit b811b47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ def parse_llvm_nm_symbols(output):
filename_pos = entry_pos

filename = line[:filename_pos]
if entry_pos + 14 >= len(line):
exit_with_error('error parsing output of llvm-nm: `%s`\nIf the symbol name here contains a colon, and starts with __invoke_, then the object file was likely built with and old version of llvm.' % line)

status = line[entry_pos + 11] # Skip address, which is always fixed-length 8 chars.
symbol = line[entry_pos + 13:]

Expand Down

0 comments on commit b811b47

Please sign in to comment.