* renamed test files to be consistent
* added a real-life test file - the libelf SO on 32-bit
* fixed a formatting difference in readelf.py
* enabled selecting which test files to run on in run_tests.py
diff --git a/scripts/readelf.py b/scripts/readelf.py
index 69293cc..8f1c27f 100755
--- a/scripts/readelf.py
+++ b/scripts/readelf.py
@@ -289,21 +289,25 @@
 
             for rel in section.iter_relocations():
                 hexwidth = 8 if self.elffile.elfclass == 32 else 12
-                symbol = symtable.get_symbol(rel['r_info_sym'])
-                self._emit('%s  %s %-17.17s %s %s%s' % (
+                self._emit('%s  %s %-17.17s' % (
                     self._format_hex(rel['r_offset'], 
                         fieldsize=hexwidth, lead0x=False),
                     self._format_hex(rel['r_info'], 
                         fieldsize=hexwidth, lead0x=False),
                     describe_reloc_type(
-                        rel['r_info_type'], self.elffile['e_machine']),
+                        rel['r_info_type'], self.elffile['e_machine'])))
+
+                if rel['r_info_sym'] == 0:
+                    self._emitline()
+                    continue
+
+                symbol = symtable.get_symbol(rel['r_info_sym'])
+                self._emit(' %s %s%s' % (
                     self._format_hex(
                         symbol['st_value'],
                         fullhex=True, lead0x=False),
                     '  ' if self.elffile.elfclass == 32 else '',
-                    symbol.name,
-                    ))
-
+                    symbol.name))
                 if section.is_RELA():
                     self._emit(' %s %x' % (
                         '+' if rel['r_addend'] >= 0 else '-',
@@ -345,7 +349,7 @@
 
             for i in range(linebytes):
                 c = data[dataptr + i]
-                if c >= ' ' and ord(c) <= 0x7f:
+                if c >= ' ' and ord(c) < 0x7f:
                     self._emit(c)
                 else:
                     self._emit('.')
diff --git a/tests/run_tests.py b/tests/run_tests.py
index a369b5e..fda2371 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -64,8 +64,8 @@
                 return False
             stdouts.append(stdout)
         testlog.info('....comparing output...')
-        success, errmsg = compare_output(*stdouts)
-        if success:
+        rc, errmsg = compare_output(*stdouts)
+        if rc:
             testlog.info('.......................SUCCESS')
         else:
             success = False
@@ -97,11 +97,12 @@
     for i in range(len(lines1)):
         if 'Symbol table' in lines1[i]:
             flag_after_symtable = True
+
         # Compare ignoring whitespace
         if lines1[i].split() != lines2[i].split():
+            sm = SequenceMatcher()
+            sm.set_seqs(lines1[i], lines2[i])
             if flag_after_symtable:
-                sm = SequenceMatcher()
-                sm.set_seqs(lines1[i], lines2[i])
                 # Detect readelf's adding @ with lib and version after 
                 # symbol name.
                 changes = sm.get_opcodes()
@@ -145,8 +146,16 @@
     if not is_in_rootdir():
         die('Please run me from the root dir of pyelftools!')
 
+    # If file names are given as command-line arguments, only these files
+    # are taken as inputs. Otherwise, autodiscovery is performed.
+    #
+    if len(sys.argv) > 1:
+        filenames = sys.argv[1:]
+    else:
+        filenames = list(discover_testfiles('tests/testfiles'))
+
     success = True
-    for filename in discover_testfiles('tests/testfiles'):
+    for filename in filenames:
         success = success and run_test_on_file(filename)
 
     if success:
diff --git a/tests/testfiles/z32.elf b/tests/testfiles/exe_simple32.elf
similarity index 100%
rename from tests/testfiles/z32.elf
rename to tests/testfiles/exe_simple32.elf
Binary files differ
diff --git a/tests/testfiles/z.elf b/tests/testfiles/exe_simple64.elf
similarity index 100%
rename from tests/testfiles/z.elf
rename to tests/testfiles/exe_simple64.elf
Binary files differ
diff --git a/tests/testfiles/zstrip.elf b/tests/testfiles/exe_stripped64.elf
similarity index 100%
rename from tests/testfiles/zstrip.elf
rename to tests/testfiles/exe_stripped64.elf
Binary files differ
diff --git a/tests/testfiles/libelf0_8_13_32bit.so.elf b/tests/testfiles/libelf0_8_13_32bit.so.elf
new file mode 100755
index 0000000..c236625
--- /dev/null
+++ b/tests/testfiles/libelf0_8_13_32bit.so.elf
Binary files differ
diff --git a/tests/testfiles/z32.o.elf b/tests/testfiles/obj_simple32.o.elf
similarity index 100%
rename from tests/testfiles/z32.o.elf
rename to tests/testfiles/obj_simple32.o.elf
Binary files differ