mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 05:47:26 +08:00
ar many_files test
This tests for the issue fixed with git commit 0490dd41ae. * testsuite/binutils-all/ar.exp (many_files): New test.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2020-05-23 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* testsuite/binutils-all/ar.exp (many_files): New test.
|
||||||
|
|
||||||
2020-05-21 Alan Modra <amodra@gmail.com>
|
2020-05-21 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* addr2line.c: Replace "if (x) free (x)" with "free (x)" throughout.
|
* addr2line.c: Replace "if (x) free (x)" with "free (x)" throughout.
|
||||||
|
@ -649,6 +649,61 @@ proc extract_an_element { } {
|
|||||||
|
|
||||||
pass $testname
|
pass $testname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc many_files { } {
|
||||||
|
global AR
|
||||||
|
global AS
|
||||||
|
global srcdir
|
||||||
|
global subdir
|
||||||
|
|
||||||
|
set testname "ar many files"
|
||||||
|
|
||||||
|
set ofiles {}
|
||||||
|
set max_file 150
|
||||||
|
for { set i 0 } { $i < $max_file } { incr i } {
|
||||||
|
set sfile "tmpdir/d-$i.s"
|
||||||
|
if [catch { set ofd [open $sfile w] } x] {
|
||||||
|
perror "$x"
|
||||||
|
unresolved $testname
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
puts $ofd " .globl data_sym$i"
|
||||||
|
puts $ofd " .data"
|
||||||
|
puts $ofd "data_sym$i:"
|
||||||
|
puts $ofd " .long $i"
|
||||||
|
close $ofd
|
||||||
|
|
||||||
|
set ofile "tmpdir/d-$i.o"
|
||||||
|
if ![binutils_assemble $sfile $ofile] {
|
||||||
|
unresolved $testname
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set objfile $ofile
|
||||||
|
if [is_remote host] {
|
||||||
|
remote_file host delete $sfile
|
||||||
|
set objfile [remote_download host $ofile]
|
||||||
|
remote_file build delete $ofile
|
||||||
|
}
|
||||||
|
remote_file build delete $sfile
|
||||||
|
lappend ofiles $objfile
|
||||||
|
}
|
||||||
|
|
||||||
|
set archive tmpdir/many.a
|
||||||
|
remote_file host delete $archive
|
||||||
|
|
||||||
|
set got [binutils_run $AR "cr $archive $ofiles"]
|
||||||
|
if ![string match "" $got] {
|
||||||
|
fail $testname
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
remote_file host delete $archive
|
||||||
|
eval remote_file host delete $ofiles
|
||||||
|
|
||||||
|
pass $testname
|
||||||
|
}
|
||||||
|
|
||||||
# Run the tests.
|
# Run the tests.
|
||||||
|
|
||||||
@ -670,6 +725,7 @@ delete_an_element
|
|||||||
delete_an_element
|
delete_an_element
|
||||||
move_an_element
|
move_an_element
|
||||||
empty_archive
|
empty_archive
|
||||||
|
extract_an_element
|
||||||
many_files
|
many_files
|
||||||
|
|
||||||
if { [is_elf_format] && [supports_gnu_unique] } {
|
if { [is_elf_format] && [supports_gnu_unique] } {
|
||||||
|
Reference in New Issue
Block a user