diff --git a/Tools/PyUtils/bin/dso-stats.py b/Tools/PyUtils/bin/dso-stats.py
index 41ede670c3a25e72dbeb40c18adbd966cc8f94b8..435ce930f1f0335961d9062668e04efb62f07a8a 100755
--- a/Tools/PyUtils/bin/dso-stats.py
+++ b/Tools/PyUtils/bin/dso-stats.py
@@ -12,23 +12,6 @@ import re
 import sys
 import os
 import subprocess
-import six
-
-## monkey patch subprocess to be forward compatible with py-3k
-def getstatusoutput(cmd):
-    if isinstance(cmd, str):
-        cmd = cmd.split()
-    if not isinstance(cmd, (list, tuple)):
-        raise TypeError('expects a list, a tuple or a space separated string')
-    encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-    process = subprocess.Popen(cmd,
-                               stdout=subprocess.PIPE,
-                               stderr=subprocess.STDOUT,
-                               **encargs)
-    stdout, _ = process.communicate()
-    return process.returncode, stdout
-subprocess.getstatusoutput = getstatusoutput
-del getstatusoutput
 
 def getstatus(cmd):
     sc,_ = subprocess.getstatusoutput(cmd)
@@ -55,7 +38,7 @@ del _getpagesz
 
 pat = re.compile (' *[0-9]* ([^ ]+) *([0-9a-f]+)')
 
-format = "%(name)-30s %(dso)5s %(code)5s %(puredata)5s %(cpp)5s %(initdata)5s %(bss)5s %(frag)5s %(total)6s"
+format = "%(name)-30s %(dso)5s %(code)5s %(puredata)5s %(cpp)5s %(initdata)5s %(bss)5s %(tbss)5s %(frag)5s %(total)6s"
 
 def parse_lib (lib):
     out = subprocess.getoutput ("objdump -h " + lib)
@@ -94,11 +77,12 @@ class Data:
         self.java = 0
         self.initdata = 0
         self.bss = 0
+        self.tbss = 0
         self.frag = 0
 
         self.ro = 0
         self.rw = 0
-        
+
         if secs:
             self.add_secs (secs)
             self.est_frag()
@@ -113,6 +97,7 @@ class Data:
         self.java += other.java
         self.initdata += other.initdata
         self.bss += other.bss
+        self.tbss += other.tbss
         self.ro += other.ro
         self.rw += other.rw
         self.frag += other.frag
@@ -123,12 +108,13 @@ class Data:
         self.frag += _frag (self.ro)
         self.frag += _frag (self.rw)
         self.frag += _frag (self.bss)
+        self.frag += _frag (self.tbss)
         return
 
 
     def total (self):
         return (self.dso + self.code + self.puredata + self.cpp +
-                self.java + self.initdata + self.frag + self.bss)
+                self.java + self.initdata + self.frag + self.bss + self.tbss)
 
 
     def add_secs (self, secs):
@@ -157,7 +143,7 @@ class Data:
                 self.cpp += sz
                 self.rw += sz
 
-                
+
             elif s in ['.jcr']:
                 self.java += sz
                 self.rw += sz
@@ -173,6 +159,9 @@ class Data:
             elif s in ['.bss']:
                 self.bss += sz
 
+            elif s in ['.tbss']:
+                self.tbss += sz
+
             elif s in ['.comment', '.gnu_debuglink'] or s.startswith ('.debug'):
                 pass
 
@@ -194,53 +183,50 @@ class Data:
         kw['initdata'] = _form (self.initdata)
         kw['frag'] = _form (self.frag)
         kw['bss'] = _form (self.bss)
+        kw['tbss'] = _form (self.tbss)
         kw['total'] = _form (self.total())
         print (format % kw, file=f)
-        
-
-# secs = parse_lib (lib)
-# data = Data(secs, name = lib)
-# print data.dso, data.code, data.puredata, data.cpp, data.java, data.initdata, data.bss
-# print data.ro, data.rw, data.frag
-
-# data2 = Data(secs)
-# data += data2
-# print data.dso, data.code, data.puredata, data.cpp, data.java, data.initdata, data.bss
-# print data.ro, data.rw, data.frag
-
-
-
-# data.dump (sys.stdout)
-
-
-kw = {'name' : 'Name',
-      'dso'  : 'DSO',
-      'code' : 'Code',
-      'puredata': 'Pure',
-      'cpp'  : 'C++',
-      'java' : 'Java',
-      'initdata': 'data',
-      'bss'  : 'BSS',
-      'frag' : 'Frag',
-      'total': 'Total'}
-print (format % kw, file=sys.stdout)
-
-
-total = Data(name = 'Total')
-import fileinput
-libs = []
-for l in fileinput.input():
-    if l[-1] == '\n':
-        l = l[:-1]
-    if l[-1] == '*':
-        l = l[:-1]
-    secs = parse_lib(l)
-    data = Data (secs, name = l)
-    libs.append (data)
-    total += data
-
-libs.sort (key = lambda x: x.total(), reverse=True)
-
-for l in libs:
-    l.dump (sys.stdout)
-total.dump (sys.stdout)
+
+def main():
+
+   import optparse
+   parser = optparse.OptionParser(description="compile size statistics for shared libraries",
+                                              usage="%prog LIB [LIB...]")
+
+   (opt, args) = parser.parse_args()
+   if len(args)==0:
+        parser.error("Invalid number of arguments specified")
+
+   libs = []
+   total = Data(name = 'Total')
+   for lib in args:
+        secs = parse_lib(lib)
+        data = Data (secs, name = lib)
+        libs.append (data)
+        total += data
+   libs.sort (key = lambda x: x.total(), reverse=True)
+   kw = {'name' : 'Name',
+         'dso'  : 'DSO',
+         'code' : 'Code',
+         'puredata': 'Pure',
+         'cpp'  : 'C++',
+         'java' : 'Java',
+         'initdata': 'data',
+         'bss'  : 'BSS',
+         'tbss' : 'TBSS',
+         'frag' : 'Frag',
+         'total': 'Total'}
+   print (format % kw, file=sys.stdout)
+   for l in libs:
+        l.dump (sys.stdout)
+   total.dump (sys.stdout)
+
+   return 0
+
+
+if __name__ == "__main__":
+   try:
+        sys.exit(main())
+   except KeyboardInterrupt:
+        sys.exit(1)
+