mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 00:52:16 +08:00
Allow zero length archive elements.
bfd PR binutils/19775 * archive.c (bfd_generic_openr_next_archived_file): Allow zero length elements in the archive. binutils PR binutils/19775 * testsuite/binutils-all/ar.exp (proc empty_archive): New proc. Run the new proc. * testsuite/binutils-all/empty: New, empty, file.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2016-03-07 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR binutils/19775
|
||||||
|
* archive.c (bfd_generic_openr_next_archived_file): Allow zero
|
||||||
|
length elements in the archive.
|
||||||
|
|
||||||
2016-03-07 Jiong Wang <jiong.wang@arm.com>
|
2016-03-07 Jiong Wang <jiong.wang@arm.com>
|
||||||
|
|
||||||
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got
|
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got
|
||||||
|
@ -802,7 +802,7 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
|
|||||||
Note that last_file->origin can be odd in the case of
|
Note that last_file->origin can be odd in the case of
|
||||||
BSD-4.4-style element with a long odd size. */
|
BSD-4.4-style element with a long odd size. */
|
||||||
filestart += filestart % 2;
|
filestart += filestart % 2;
|
||||||
if (filestart <= last_file->proxy_origin)
|
if (filestart < last_file->proxy_origin)
|
||||||
{
|
{
|
||||||
/* Prevent looping. See PR19256. */
|
/* Prevent looping. See PR19256. */
|
||||||
bfd_set_error (bfd_error_malformed_archive);
|
bfd_set_error (bfd_error_malformed_archive);
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2016-03-07 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR binutils/19775
|
||||||
|
* testsuite/binutils-all/ar.exp (proc empty_archive): New proc.
|
||||||
|
Run the new proc.
|
||||||
|
* testsuite/binutils-all/empty: New, empty, file.
|
||||||
|
|
||||||
2016-03-04 Matthew Wahab <matthew.wahab@arm.com>
|
2016-03-04 Matthew Wahab <matthew.wahab@arm.com>
|
||||||
|
|
||||||
* readelf.c (arm_attry_tag_FP_arch): Add "NEON for ARMv8.1".
|
* readelf.c (arm_attry_tag_FP_arch): Add "NEON for ARMv8.1".
|
||||||
|
@ -555,6 +555,45 @@ proc move_an_element { } {
|
|||||||
pass $testname
|
pass $testname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PR 19775: Test creating and listing archives with an empty element.
|
||||||
|
|
||||||
|
proc empty_archive { } {
|
||||||
|
global AR
|
||||||
|
global srcdir
|
||||||
|
global subdir
|
||||||
|
|
||||||
|
set testname "archive with empty element"
|
||||||
|
|
||||||
|
# FIXME: There ought to be a way to dynamically create an empty file.
|
||||||
|
set empty $srcdir/$subdir/empty
|
||||||
|
|
||||||
|
if [is_remote host] {
|
||||||
|
set archive artest.a
|
||||||
|
set objfile [remote_download host $empty]
|
||||||
|
remote_file host delete $archive
|
||||||
|
} else {
|
||||||
|
set archive tmpdir/artest.a
|
||||||
|
set objfile $empty
|
||||||
|
}
|
||||||
|
|
||||||
|
remote_file build delete tmpdir/artest.a
|
||||||
|
|
||||||
|
set got [binutils_run $AR "-r -c $archive ${objfile}"]
|
||||||
|
if ![string match "" $got] {
|
||||||
|
fail $testname
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# This commmand used to fail with: "Malformed archive".
|
||||||
|
set got [binutils_run $AR "-t $archive"]
|
||||||
|
if ![string match "empty
|
||||||
|
" $got] {
|
||||||
|
fail $testname
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
pass $testname
|
||||||
|
}
|
||||||
|
|
||||||
# Run the tests.
|
# Run the tests.
|
||||||
|
|
||||||
@ -574,6 +613,7 @@ argument_parsing
|
|||||||
argument_parsing
|
argument_parsing
|
||||||
deterministic_archive
|
deterministic_archive
|
||||||
delete_an_element
|
delete_an_element
|
||||||
|
move_an_element
|
||||||
empty_archive
|
empty_archive
|
||||||
|
|
||||||
if { [is_elf_format]
|
if { [is_elf_format]
|
||||||
|
0
binutils/testsuite/binutils-all/empty
Normal file
0
binutils/testsuite/binutils-all/empty
Normal file
Reference in New Issue
Block a user