[binutils-gdb] Correct readelf thin archive test

Alan Modra amodra@sourceware.org
Thu Aug 14 13:24:21 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=58abb43bc543801662192f2af9efc6aea49cebd3

commit 58abb43bc543801662192f2af9efc6aea49cebd3
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Aug 12 22:46:58 2025 +0930

    Correct readelf thin archive test
    
    If we have an existing archive, the test may fail due to it being the
    wrong format.  Also, downloading bintest.thin.a from a remote host
    (before creating it!) is wrong.
    
            * testsuite/binutils-all/readelf.exp (readelf_thin_archive_test):
            Don't remote_download bintest.thin.a.  Delete lib before
            creating.

Diff:
---
 binutils/testsuite/binutils-all/readelf.exp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 571bb9986a1..22f2a355bfd 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -317,22 +317,21 @@ proc readelf_thin_archive_test {} {
 
     if ![is_remote host] {
 	set tempfile tmpdir/bintest.o
-        set templib  tmpdir/bintest.thin.a
         set libname  tmpdir/bintest.thin.a
     } else {
 	set tempfile [remote_download host tmpdir/bintest.o]
-        set templib  [remote_download host tmpdir/bintest.thin.a]
         set libname  bintest.thin.a
     }
 
     set testname "readelf -h bintest.thin"
+    file_on_host delete $libname
     set got [binutils_run $AR "rcT $libname ${tempfile}"]
     if ![string match "" $got] {
         fail $testname
         return
     }
 
-    readelf_test -h $templib readelf.h.thin
+    readelf_test -h $libname readelf.h.thin
 
     pass $testname
 }


More information about the Binutils-cvs mailing list