This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR binutils/12408: "readelf -w" doesn't reset dump_sects on archive
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Tue, 18 Jan 2011 09:45:02 -0800
- Subject: PATCH: PR binutils/12408: "readelf -w" doesn't reset dump_sects on archive
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
I checked in this patch to free and reset dump_sects after processing
each archive member as an obvious fix.
H.J.
---
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 9287fda..4e62cdc 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/12408
+ * readelf.c (process_archive): Free and reset dump_sects
+ after processing each archive member.
+
2011-01-11 Andreas Schwab <schwab@redhat.com>
* readelf.c (print_symbol): Handle symbol characters as unsigned.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index a9f271d..abc251a 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -12640,6 +12640,13 @@ process_archive (char * file_name, FILE * file, bfd_boolean is_thin_archive)
ret |= process_object (qualified_name, file);
}
+ if (dump_sects != NULL)
+ {
+ free (dump_sects);
+ dump_sects = NULL;
+ num_dump_sects = 0;
+ }
+
free (qualified_name);
}