Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99cdf538 authored by Logan Chien's avatar Logan Chien
Browse files

Update check_elf_file.py for clang-r353983

This commit updates how `check_elf_file.py` parses the symbol name
because the `llvm-readobj` (from clang-r353983) does not print "@" if
the symbol is not versioned.

See also. https://reviews.llvm.org/D56319

Bug: 128959554
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I0dee5e505225e57750a2c86cf0d25a151c218eb1
parent 88e38f01
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -260,13 +260,20 @@ class ELFParser(object):
  _SYMBOL_ENTRY_END_PATTERN = '  }'


  @classmethod
  def _parse_symbol_name(cls, name_with_version):
  @staticmethod
  def _parse_symbol_name(name_with_version):
    """Split `name_with_version` into name and version. This function may split
    at last occurrence of `@@` or `@`."""
    name, version = name_with_version.rsplit('@', 1)
    if name and name[-1] == '@':
      name = name[:-1]
    pos = name_with_version.rfind('@')
    if pos == -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)