This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
A question about display_archive in binutils
- From: Nan Xiao <xiaonan830818 at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 17 Oct 2017 12:29:07 +0800
- Subject: A question about display_archive in binutils
- Authentication-results: sourceware.org; auth=none
Hi maintainers of binutils,
Greetings from me!
I am reading bintutils code, and come across this commit
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=896ca0981329171639b1fe0b934393a79ef4fdfb)
about display_archive function in both nm.c and size.c:
if (last_arfile != NULL)
- bfd_close (last_arfile);
+ {
+ bfd_close (last_arfile);
+
+ /* PR 17512: file: a244edbc. */
+ if (last_arfile == arfile)
+ return;
+ }
I am a little confused why there will occur last_arfile is equal
to arfile. So it means bfd_openr_next_archived_file allocates the
same memory in 2 consecutive times?
Thanks very much in advance!
Best Regards
Nan Xiao