comparison llvm/utils/extract_symbols.py @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
172:9fbae9c8bf63 173:0572611fdcc8
40 if match: 40 if match:
41 yield match.group(1) 41 yield match.group(1)
42 process.wait() 42 process.wait()
43 43
44 def nm_get_symbols(lib): 44 def nm_get_symbols(lib):
45 process = subprocess.Popen(['nm','-P',lib], bufsize=1, 45 if sys.platform.startswith('aix'):
46 stdout=subprocess.PIPE, stdin=subprocess.PIPE, 46 process = subprocess.Popen(['nm','-P','-Xany','-C','-p',lib], bufsize=1,
47 universal_newlines=True) 47 stdout=subprocess.PIPE, stdin=subprocess.PIPE,
48 universal_newlines=True)
49 else:
50 process = subprocess.Popen(['nm','-P',lib], bufsize=1,
51 stdout=subprocess.PIPE, stdin=subprocess.PIPE,
52 universal_newlines=True)
48 process.stdin.close() 53 process.stdin.close()
49 for line in process.stdout: 54 for line in process.stdout:
50 # Look for external symbols that are defined in some section 55 # Look for external symbols that are defined in some section
51 match = re.match("^(\S+)\s+[BDGRSTVW]\s+\S+\s+\S+$", line) 56 match = re.match("^(\S+)\s+[BDGRSTVW]\s+\S+\s+\S+$", line)
52 if match: 57 if match: