tools/binary_size/libsupersize/linker_map_parser.py
def DetectLinkerNameFromMapFile(lines):
  """Heuristic linker detection from partial scan of the linker map.

  Args:
    lines: Iterable of lines from the linker map.

  Returns:
    A coded linker name.

  """
  first_line = next(lines)

  if first_line.startswith('Address'):
    return 'lld-lto_v0' if _DetectLto(lines) else 'lld_v0'

  if first_line.lstrip().startswith('VMA'):
    return 'lld-lto_v1' if _DetectLto(lines) else 'lld_v1'

  if first_line.startswith('Archive member'):
    return 'gold'

  raise Exception('Invalid map file: ' + first_line)
Heuristic linker detection from partial scan of the linker map.

  Args:
    lines: Iterable of lines from the linker map.

  Returns:
    A coded linker name.

  
Heuristic linker detection from partial scan of the linker map.
Heuristic linker detection from partial scan of the linker map .
def DetectLinkerNameFromMapFile(lines):
  first_line = next(lines)
  if first_line.startswith('Address'):
    return 'lld-lto_v0' if _DetectLto(lines) else 'lld_v0'
  if first_line.lstrip().startswith('VMA'):
    return 'lld-lto_v1' if _DetectLto(lines) else 'lld_v1'
  if first_line.startswith('Archive member'):
    return 'gold'
  raise Exception('Invalid map file: ' + first_line)
def DetectLinkerNameFromMapFile ( lines ) : first_line = next ( lines ) if first_line . startswith ( 'Address' ) : return 'lld-lto_v0' if _DetectLto ( lines ) else 'lld_v0' if first_line . lstrip ( ) . startswith ( 'VMA' ) : return 'lld-lto_v1' if _DetectLto ( lines ) else 'lld_v1' if first_line . startswith ( 'Archive member' ) : return 'gold' raise Exception ( 'Invalid map file: ' + first_line )
Heuristic linker detection from partial scan of the linker map.
Heuristic linker detection from partial scan of the linker map .
"""Heuristic linker detection from partial scan of the linker map.

  Args:
    lines: Iterable of lines from the linker map.

  Returns:
    A coded linker name.

  """
A coded linker name.
A coded linker name .
lines
Iterable of lines from the linker map.
Iterable of lines from the linker map .