17 if len(sys.argv) != 2:
18 print "Usage: %s FILE" % sys.argv[0]
21 readelf = os.getenv(
"READELF",
"readelf")
23 start_pattern = re.compile(
"<([^>]*)>: \[0x([0-9a-f]+)-0x([0-9a-f]+)\]")
24 rlen_pattern = re.compile(
".*rlen=([0-9]+)")
30 if not func: func =
"[%#x-%#x]" % (start, end)
31 print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum)
39 for line
in os.popen(
"%s -u %s" % (readelf, sys.argv[1])):
40 m = start_pattern.match(line)
45 start =
long(m.group(2), 16)
47 slots = 3 * (end - start) / 16
51 m = rlen_pattern.match(line)
53 rlen_sum +=
long(m.group(1))
57 print "No errors detected in %u functions." % num_funcs
63 print "%u %s detected in %u functions." % (num_errors, err, num_funcs)