From: H.J. Lu Date: Wed, 30 Sep 2015 17:50:36 +0000 (-0700) Subject: Handle symbolic link when copying source file X-Git-Tag: users/hjl/linux/release/2.25.51.0.4~1^2~20^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ee959fb247a677b048ce3c59c1399c023a400d9;p=thirdparty%2Fbinutils-gdb.git Handle symbolic link when copying source file * lib/utils-lib.exp (run_dump_test): Handle symbolic link when copying source file. --- diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index f444dc7c007..3f9b3e5aba2 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-30 H.J. Lu + + * lib/utils-lib.exp (run_dump_test): Handle symbolic link when + copying source file. + 2015-09-29 H.J. Lu PR binutils/19020 diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp index fd5b6f630a3..d08820122f5 100644 --- a/binutils/testsuite/lib/utils-lib.exp +++ b/binutils/testsuite/lib/utils-lib.exp @@ -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)]