tools/binary_size/libsupersize/readelf.py
def ArchFromElf(elf_path, tool_prefix):
  """Returns the GN architecture for the given binary."""
  args = [path_util.GetReadElfPath(tool_prefix), '-h', elf_path]
  stdout = subprocess.check_output(args, encoding='ascii')
  machine = re.search('Machine:\s*(.+)', stdout).group(1)
  if machine == 'Intel 80386':
    return 'x86'
  if machine == 'Advanced Micro Devices X86-64':
    return 'x64'
  if machine == 'ARM':
    return 'arm'
  if machine == 'AArch64':
    return 'arm64'
  return machine
Returns the GN architecture for the given binary.
Returns the GN architecture for the given binary.
Returns the GN architecture for the given binary .
def ArchFromElf(elf_path, tool_prefix):
  args = [path_util.GetReadElfPath(tool_prefix), '-h', elf_path]
  stdout = subprocess.check_output(args, encoding='ascii')
  machine = re.search('Machine:\s*(.+)', stdout).group(1)
  if machine == 'Intel 80386':
    return 'x86'
  if machine == 'Advanced Micro Devices X86-64':
    return 'x64'
  if machine == 'ARM':
    return 'arm'
  if machine == 'AArch64':
    return 'arm64'
  return machine
def ArchFromElf ( elf_path , tool_prefix ) : args = [ path_util . GetReadElfPath ( tool_prefix ) , '-h' , elf_path ] stdout = subprocess . check_output ( args , encoding = 'ascii' ) machine = re . search ( 'Machine:\s*(.+)' , stdout ) . group ( 1 ) if machine == 'Intel 80386' : return 'x86' if machine == 'Advanced Micro Devices X86-64' : return 'x64' if machine == 'ARM' : return 'arm' if machine == 'AArch64' : return 'arm64' return machine
Returns the GN architecture for the given binary.
Returns the GN architecture for the given binary .
"""Returns the GN architecture for the given binary."""
elf_path
tool_prefix