Merge "Update check_elf_file.py for clang-r353983"

am: 81589605fd

Change-Id: I0bdb631d5eeae4fd834efa5255ae472d76763935
This commit is contained in:
Logan Chien 2019-03-21 01:19:49 -07:00 committed by android-build-merger
commit 5d00745b0a

View file

@ -260,13 +260,20 @@ class ELFParser(object):
_SYMBOL_ENTRY_END_PATTERN = ' }' _SYMBOL_ENTRY_END_PATTERN = ' }'
@classmethod @staticmethod
def _parse_symbol_name(cls, name_with_version): def _parse_symbol_name(name_with_version):
"""Split `name_with_version` into name and version. This function may split """Split `name_with_version` into name and version. This function may split
at last occurrence of `@@` or `@`.""" at last occurrence of `@@` or `@`."""
name, version = name_with_version.rsplit('@', 1) pos = name_with_version.rfind('@')
if name and name[-1] == '@': if pos == -1:
name = name[:-1] name = name_with_version
version = ''
else:
if pos > 0 and name_with_version[pos - 1] == '@':
name = name_with_version[0:pos - 1]
else:
name = name_with_version[0:pos]
version = name_with_version[pos + 1:]
return (name, version) return (name, version)