orca-software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
elf-size-analyze.Symbol Class Reference

Public Member Functions

def __init__ (self, num, name, value, size, type, bind, visibility, section, file=None, line=None)
 
def __repr__ (self)
 
def from_readelf_line (cls, line, ignored_types=['NOTYPE', SECTION, FILE, ignore_zero_size=True)
 
def extract_elf_symbols_info (cls, elf_file, readelf_exe='readelf')
 

Public Attributes

 num
 
 name
 
 value
 
 size
 
 type
 
 bind
 
 visibility
 
 section
 
 file
 
 line
 

Static Public Attributes

list pattern_fields
 
string pattern = r'^{}$'.format(r''.join(pattern_fields))
 
 pattern = re.compile(pattern)
 

Detailed Description

Represents a linker symbol in an ELF file. Attributes are as in the output
of readelf command. Additionally, has optional file path and line number.

Member Function Documentation

§ extract_elf_symbols_info()

def elf-size-analyze.Symbol.extract_elf_symbols_info (   cls,
  elf_file,
  readelf_exe = 'readelf' 
)
Uses binutils 'readelf' to find info about all symbols from an ELF file.

§ from_readelf_line()

def elf-size-analyze.Symbol.from_readelf_line (   cls,
  line,
  ignored_types = ['NOTYPE',
  SECTION,
  FILE,
  ignore_zero_size = True 
)
Create a Symbol from a line of `readelf -Ws` output.

Member Data Documentation

§ pattern_fields

list elf-size-analyze.Symbol.pattern_fields
static
Initial value:
= [
r'\s*',
g('num', r'\d+'), r':',
r'\s+',
g('value', r'[0-9a-fA-F]+'),
r'\s+',
g('size', r'[0-9]+'),
r'\s+',
g('type', r'\S+'),
r'\s+',
g('bind', r'\S+'),
r'\s+',
g('visibility', r'\S+'),
r'\s+',
g('section', r'\S+'),
r'\s+',
g('name', r'.*'),
]

The documentation for this class was generated from the following file: