This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] Handle symbolic link when copying source file
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Wed, 30 Sep 2015 10:52:01 -0700
- Subject: [committed, PATCH] Handle symbolic link when copying source file
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
* lib/utils-lib.exp (run_dump_test): Handle symbolic link when
copying source file.
---
binutils/testsuite/ChangeLog | 5 +++++
binutils/testsuite/lib/utils-lib.exp | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index f444dc7..3f9b3e5 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -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
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index fd5b6f6..d088201 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)]
--
2.4.3