parameters: (executable, imports=True)
return_statement: return syms
docstring: Parse an ELF executable and return a list of (symbol,version) tuples
      for dynamic, imported symbols.
docstring_summary: Parse an ELF executable and return a list of (symbol,version) tuples
      for dynamic, imported symbols.
docstring_tokens: Parse an ELF executable and return a list of ( symbol version ) tuples for dynamic imported symbols .
function: def read_symbols(executable, imports=True):
      '''
      Parse an ELF executable and return a list of (symbol,version) tuples
      for dynamic, imported symbols.
      '''
      p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
      (stdout, stderr) = p.communicate()
      if p.returncode:
          raise IOError('Could not read symbols for %s: %s' % (executable, stderr.strip()))
      syms = []
      for line in stdout.split('\n'):
          line = line.split()
          if len(line)>7 and re.match('[0-9]+:$', line[0]):
              (sym, _, version) = line[7].partition('@')
              is_import = line[6] == 'UND'
              if version.startswith('@'):
                  version = version[1:]
              if is_import == imports:
                  syms.append((sym, version))
      return syms
function_tokens: def read_symbols ( executable , imports = True ) : p = subprocess . Popen ( [ READELF_CMD , '--dyn-syms' , '-W' , executable ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE , stdin = subprocess . PIPE ) ( stdout , stderr ) = p . communicate ( ) if p . returncode : raise IOError ( 'Could not read symbols for %s: %s' % ( executable , stderr . strip ( ) ) ) syms = [ ] for line in stdout . split ( '\n' ) : line = line . split ( ) if len ( line ) > 7 and re . match ( '[0-9]+:$' , line [ 0 ] ) : ( sym , _ , version ) = line [ 7 ] . partition ( '@' ) is_import = line [ 6 ] == 'UND' if version . startswith ( '@' ) : version = version [ 1 : ] if is_import == imports : syms . append ( ( sym , version ) ) return syms