binman: Use the Makefile for u_boot_ucode_ptr

Remove this file from git and instead build it using the Makefile.

Update tools.GetInputFilename() to support reading files from an absolute
path, so that we can read the Elf test files easily. Also make sure that
the temp directory is report in ELF tests as this was commented out.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py
index 736b931..403ca2b 100644
--- a/tools/binman/elf_test.py
+++ b/tools/binman/elf_test.py
@@ -75,18 +75,29 @@
 
 class TestElf(unittest.TestCase):
     @classmethod
-    def setUpClass(self):
+    def setUpClass(cls):
+        cls._indir = tempfile.mkdtemp(prefix='elf.')
         tools.SetInputDirs(['.'])
+        BuildElfTestFiles(cls._indir)
+
+    @classmethod
+    def tearDownClass(cls):
+        if cls._indir:
+            shutil.rmtree(cls._indir)
+
+    @classmethod
+    def ElfTestFile(cls, fname):
+        return os.path.join(cls._indir, fname)
 
     def testAllSymbols(self):
         """Test that we can obtain a symbol from the ELF file"""
-        fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr')
+        fname = self.ElfTestFile('u_boot_ucode_ptr')
         syms = elf.GetSymbols(fname, [])
         self.assertIn('.ucode', syms)
 
     def testRegexSymbols(self):
         """Test that we can obtain from the ELF file by regular expression"""
-        fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr')
+        fname = self.ElfTestFile('u_boot_ucode_ptr')
         syms = elf.GetSymbols(fname, ['ucode'])
         self.assertIn('.ucode', syms)
         syms = elf.GetSymbols(fname, ['missing'])
@@ -201,7 +212,7 @@
         self.assertEqual(elf.ElfInfo(b'\0\0' + expected[2:],
                                      load, entry, len(expected)),
                          elf.DecodeElf(data, load + 2))
-        #shutil.rmtree(outdir)
+        shutil.rmtree(outdir)
 
 
 if __name__ == '__main__':