This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add bfd_get_file_size to get archive element size


On Thu, Jul 13, 2017 at 6:22 AM, Maciej W. Rozycki <macro@imgtec.com> wrote:
> On Thu, 25 May 2017, H.J. Lu wrote:
>
>> We can't use stat() to get archive element size.  Add bfd_get_file_size
>> to get size for both normal files and archive elements.
>
>  Your changes to the test script have caused framework errors:
>
> ERROR: tcl error sourcing .../binutils/testsuite/binutils-all/objdump.exp.
> ERROR: can't read "testarchive": no such variable
>
> for a few targets, i.e. alpha-dec-vms, alpha-linuxecoff, ia64-vms.  Can
> you please look into it?  Can you add these targets to your regular
> testing (for target-independent changes, that is)?
>
>   Maciej

I checked in this patch.  Sorry for that.


-- 
H.J.
From a502b0bbb8f3fb7dca4f2a12aa04afa28173f0c2 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 13 Jul 2017 08:10:57 -0700
Subject: [PATCH] Always delete $testarchive first

Always delete $testarchive first so that it exists only when it is
supported,

	* testsuite/binutils-all/objdump.exp: Always delete $testarchive
	first.
---
 binutils/ChangeLog                          |  5 +++++
 binutils/testsuite/binutils-all/objdump.exp | 12 +++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 4f7521a8e4..19de4a0009 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* testsuite/binutils-all/objdump.exp: Always delete $testarchive
+	first.
+
 2017-07-12  Alan Modra  <amodra@gmail.com>
 
 	* po/bg.po: Update from translationproject.org/latest/binutils/.
diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp
index 3dee405340..472b749df8 100644
--- a/binutils/testsuite/binutils-all/objdump.exp
+++ b/binutils/testsuite/binutils-all/objdump.exp
@@ -75,18 +75,16 @@ if [is_remote host] {
     set testfile2 tmpdir/bintest2.o
 }
 
+# $testarchive exists only if it is supported.
+set testarchive tmpdir/bintest.a
+remote_file host file delete $testarchive
 if { ![istarget "alpha-*-*"] || [is_elf_format] } then {
-    remote_file host file delete tmpdir/bintest.a
     set got [binutils_run $AR "rc tmpdir/bintest.a $testfile2"]
     if ![string match "" $got] then {
 	fail "bintest.a"
 	remote_file host delete tmpdir/bintest.a
-    } else {
-	if [is_remote host] {
-	    set testarchive [remote_download host tmpdir/bintest.a]
-	} else {
-	    set testarchive tmpdir/bintest.a
-	}
+    } elseif [is_remote host] {
+	set testarchive [remote_download host tmpdir/bintest.a]
     }
     remote_file host delete tmpdir/bintest2.o
 }
-- 
2.13.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]