aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2022-01-11 08:59:40 -0800
committerFangrui Song <maskray@google.com>2022-01-11 08:59:40 -0800
commitd1b69c506f7855e5b90039abdadaf1d05b085c4c (patch)
tree6b5758b36eb4440cbe4d4ec50fed93ee9175f18a /binutils/testsuite/binutils-all/ar.exp
parentFix multiple problems with DLL generation. (diff)
downloadbinutils-gdb-d1b69c506f7855e5b90039abdadaf1d05b085c4c.tar.gz
binutils-gdb-d1b69c506f7855e5b90039abdadaf1d05b085c4c.tar.bz2
binutils-gdb-d1b69c506f7855e5b90039abdadaf1d05b085c4c.zip
ar: Add --thin for creating thin archives
In many ar implementations (FreeBSD, elfutils, etc), -T has the X/Open System Interface specified semantics. Therefore -T for thin archives is not recommended for portability. -T is deprecated without diagnostics. PR binutils/28759 * ar.c (long_options): Add --thin. (usage) Add --thin. Deprecate -T without diagnostics. * doc/binutils.texi: Add doc. * NEWS: Mention --thin. * binutils/testsuite/binutils-all/ar.exp: Add tests.
Diffstat (limited to 'binutils/testsuite/binutils-all/ar.exp')
-rw-r--r--binutils/testsuite/binutils-all/ar.exp17
1 files changed, 17 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index 12aa079865b..3b841825f6f 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -309,11 +309,13 @@ proc thin_archive_with_nested { bfdtests } {
if [is_remote host] {
set archive artest.a
set archive2 artest2.a
+ set archive3 artest3.a
set objfile [remote_download host tmpdir/bintest.${obj}]
remote_file host delete $archive
} else {
set archive tmpdir/artest.a
set archive2 tmpdir/artest2.a
+ set archive3 tmpdir/artest3.a
set objfile tmpdir/bintest.${obj}
}
@@ -333,6 +335,14 @@ proc thin_archive_with_nested { bfdtests } {
return
}
+ remote_file build delete tmpdir/artest3.a
+
+ set got [binutils_run $AR "rc --thin $archive3 ${archive}"]
+ if ![string match "" $got] {
+ fail $testname
+ return
+ }
+
foreach bfdtest $bfdtests {
set exec_output [binutils_run "$base_dir/$bfdtest" "$archive"]
if ![string match "" $exec_output] {
@@ -347,6 +357,13 @@ proc thin_archive_with_nested { bfdtests } {
fail "$testname ($bfdtest)"
return
}
+
+ set exec_output [binutils_run "$base_dir/$bfdtest" "$archive3"]
+ if ![string match "" $exec_output] {
+ verbose -log $exec_output
+ fail "$testname ($bfdtest)"
+ return
+ }
}
set got [binutils_run $NM "--print-armap $archive"]