Commit 0cb6474b authored by Rich Prohaska's avatar Rich Prohaska

check for globals in the lib that are not prefixed with toku. addresses #74

git-svn-id: file:///svn/tokudb@844 c7de825b-a66e-492c-adef-691d508d4ae1
parent d71d3efc
#!/usr/bin/python
import sys
import os
import re
def checkglobals(libname, exceptsymbols, verbose):
badglobals = 0
nmcmd = "nm -g " + libname
f = os.popen(nmcmd)
b = f.readline()
while b != "":
match = re.match("^([0-9a-f]+)\s(.?)\s(.*)$", b)
if match == None:
match = re.match("^\s+(.*)$", b)
if match == None:
print "unknown", b
badglobals = 1
else:
type = match.group(2)
symbol = match.group(3)
if verbose: print type, symbol
match = re.match("^toku_", symbol)
if match == None and not exceptsymbols.has_key(symbol):
print "non toku symbol=", symbol
badglobals = 1
b = f.readline()
f.close()
return badglobals
def main():
verbose = 0
for arg in sys.argv[1:]:
if arg == "-v":
verbose += 1
exceptsymbols = {}
for n in [ "_init", "_fini", "_end", "_edata", "__bss_start" ]:
exceptsymbols[n] = 1
for n in [ "db_env_create", "db_create", "db_strerror", "db_version", "log_compare" ]:
exceptsymbols[n] = 1
return checkglobals("libdb.so", exceptsymbols, verbose)
sys.exit(main())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment