tools/binary_size/libsupersize/linker_map_parser.py
def Parse(self, linker_name, lines):
    """Parses a linker map file.

    Args:
      linker_name: Coded linker name to specify a linker.
      lines: Iterable of lines from the linker map.

    Returns:
      A tuple of (section_ranges, symbols, extras).
    """
    next(lines)  # Consume the first line of headers.
    if linker_name.startswith('lld'):
      inner_parser = MapFileParserLld(linker_name)
    elif linker_name == 'gold':
      inner_parser = MapFileParserGold()
    else:
      raise Exception('.map file is from a unsupported linker.')

    section_ranges, syms, extras = inner_parser.Parse(lines)
    for sym in syms:
      if sym.object_path and not sym.object_path.endswith(')'):
        # Don't want '' to become '.'.
        # Thin archives' paths will get fixed in |ar.CreateThinObjectPath|.
        sym.object_path = os.path.normpath(sym.object_path)
    return (section_ranges, syms, extras)
Parses a linker map file.

    Args:
      linker_name: Coded linker name to specify a linker.
      lines: Iterable of lines from the linker map.

    Returns:
      A tuple of (section_ranges, symbols, extras).
    
Parses a linker map file.
Parses a linker map file .
def Parse(self, linker_name, lines):
    next(lines)  
    if linker_name.startswith('lld'):
      inner_parser = MapFileParserLld(linker_name)
    elif linker_name == 'gold':
      inner_parser = MapFileParserGold()
    else:
      raise Exception('.map file is from a unsupported linker.')
    section_ranges, syms, extras = inner_parser.Parse(lines)
    for sym in syms:
      if sym.object_path and not sym.object_path.endswith(')'):
        sym.object_path = os.path.normpath(sym.object_path)
    return (section_ranges, syms, extras)
def Parse ( self , linker_name , lines ) : next ( lines ) if linker_name . startswith ( 'lld' ) : inner_parser = MapFileParserLld ( linker_name ) elif linker_name == 'gold' : inner_parser = MapFileParserGold ( ) else : raise Exception ( '.map file is from a unsupported linker.' ) section_ranges , syms , extras = inner_parser . Parse ( lines ) for sym in syms : if sym . object_path and not sym . object_path . endswith ( ')' ) : sym . object_path = os . path . normpath ( sym . object_path ) return ( section_ranges , syms , extras )
Parses a linker map file.
Parses a linker map file .
"""Parses a linker map file.

    Args:
      linker_name: Coded linker name to specify a linker.
      lines: Iterable of lines from the linker map.

    Returns:
      A tuple of (section_ranges, symbols, extras).
    """ # Consume the first line of headers. # Don't want '' to become '.'. # Thin archives' paths will get fixed in |ar.CreateThinObjectPath|.
A tuple of (section_ranges, symbols, extras).
A tuple of ( section_ranges symbols extras ) .
self
linker_name
Coded linker name to specify a linker.
Coded linker name to specify a linker .
lines
Iterable of lines from the linker map.
Iterable of lines from the linker map .