Guest User

Untitled

a guest
Jun 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Symbols from __ctype_tab.o:
  2. Name Value Class Type Size Line Section
  3. __ctype |00000000| D | OBJECT|00000004| |.data
  4. __ctype_tab |00000000| r | OBJECT|00000101| |.rodata
  5.  
  6. Symbols from _ashldi3.o:
  7. Name Value Class Type Size Line Section
  8. __ashldi3 |00000000| T | FUNC|00000050| |.text
  9.  
  10. Symbols from _ashrdi3.o:
  11. Name Value Class Type Size Line Section
  12. __ashrdi3 |00000000| T | FUNC|00000058| |.text
  13.  
  14. Symbols from _fixdfdi.o:
  15. Name Value Class Type Size Line Section
  16. __fixdfdi |00000000| T | FUNC|0000004c| |.text
  17. __fixunsdfdi | | U | NOTYPE| | |*UND*
  18.  
  19. dictOfTables {'__ctype_tab.o':{'__ctype': Name:...,Value:...,Class:...,Type:...,Size:...,Line:...,Section:...}} etc.
  20.  
  21. import re
  22.  
  23. header_re = re.compile('Symbols from (.*):')
  24.  
  25. def read_syms(f):
  26. """Read list of symbols from provided iterator and return dict of values"""
  27. d = {}
  28. headings=None
  29. for line in f:
  30. line = line.strip()
  31. if not line: return d # Finished.
  32.  
  33. if headings is None:
  34. headings = [x.strip() for x in line.split()]
  35. continue # First line is headings
  36.  
  37. items = [x.strip() for x in line.split("|")]
  38. d[items[0]] = dict(zip(headings[1:], items[1:]))
  39. return d
  40.  
  41. f=open('input.txt')
  42. d={}
  43. for line in f:
  44. m=header_re.match(line)
  45. if m:
  46. d[m.group(1)] = read_syms(f)
Add Comment
Please, Sign In to add comment