diff options
author | Alan Modra <amodra@gmail.com> | 2023-07-11 08:19:20 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-07-12 09:31:40 +0930 |
commit | 1052fb3ecb1ae46bcf22634c48739c12e585196a (patch) | |
tree | 5a852142fdc5165d5d79c7fe4937bf94182c2465 /binutils | |
parent | 0ec80e026578acb568d9f451f25cd5de82b410df (diff) | |
download | gdb-1052fb3ecb1ae46bcf22634c48739c12e585196a.zip gdb-1052fb3ecb1ae46bcf22634c48739c12e585196a.tar.gz gdb-1052fb3ecb1ae46bcf22634c48739c12e585196a.tar.bz2 |
Re: Keeping track of rs6000-coff archive element pointers
bfd/
* coff-rs6000.c (add_range): Revise comment, noting possible fail.
(_bfd_xcoff_openr_next_archived_file): Start with clean ranges.
binutils/
* bfdtest1.c: Enhance to catch errors on second scan.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/bfdtest1.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/binutils/bfdtest1.c b/binutils/bfdtest1.c index 7235572..b81f48b 100644 --- a/binutils/bfdtest1.c +++ b/binutils/bfdtest1.c @@ -33,6 +33,7 @@ main (int argc, char **argv) { bfd *archive; bfd *last, *next; + int count; if (argc != 2) die ("usage: bfdtest1 <archive>"); @@ -47,12 +48,13 @@ main (int argc, char **argv) die ("bfd_check_format"); } - for (last = bfd_openr_next_archived_file (archive, NULL); + for (count = 0, last = bfd_openr_next_archived_file (archive, NULL); last; last = next) { next = bfd_openr_next_archived_file (archive, last); bfd_close (last); + count++; } for (last = bfd_openr_next_archived_file (archive, NULL); @@ -61,8 +63,12 @@ main (int argc, char **argv) { next = bfd_openr_next_archived_file (archive, last); bfd_close (last); + count--; } + if (count != 0) + die ("element count differs in second scan"); + if (!bfd_close (archive)) die ("bfd_close"); |