Handle symbolic link when copying source file
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 17:50:36 +0000 (10:50 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 17:50:36 +0000 (10:50 -0700)
* lib/utils-lib.exp (run_dump_test): Handle symbolic link when
copying source file.

binutils/testsuite/ChangeLog
binutils/testsuite/lib/utils-lib.exp

index f444dc7c007ec239465bc3dce421070e9e3476a1..3f9b3e5aba25db339d7c30fd98c94551dd275bca 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * lib/utils-lib.exp (run_dump_test): Handle symbolic link when
+       copying source file.
+
 2015-09-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/19020
index fd5b6f630a3d4be64ab813d19c4435008059e735..d08820122f5a979d48dcbd5c1b663d5760e425fc 100644 (file)
@@ -448,6 +448,13 @@ proc run_dump_test { name {extra_options {}} } {
     }
 
     if { $opts(as) == "binary" } {
+       while {[file type $srcfile] eq "link"} {
+           set newfile [file readlink $srcfile]
+           if {[string index $newfile 0] ne "/"} {
+               set newfile [file dirname $srcfile]/$newfile
+           }
+           set srcfile $newfile
+       }
        file copy -force ${srcfile} $tempfile
     } else {
        set exec_output [binutils_assemble_flags ${srcfile} $tempfile $opts(as)]
This page took 0.026663 seconds and 4 git commands to generate.