Bug 12408

Summary: "readelf -w" doesn't reset dump_sects on archive
Product: binutils Reporter: H.J. Lu <hjl.tools>
Component: binutilsAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.22   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description H.J. Lu 2011-01-18 17:42:35 UTC
I got

readelf -w ..
...
readelf: Warning: Section 24 was not dumped because it does not exist!
readelf: Warning: Section 24 was not dumped because it does not exist!
readelf: Warning: Section 24 was not dumped because it does not exist!
readelf: Warning: Section 24 was not dumped because it does not exist!
readelf: Warning: Section 24 was not dumped because it does not exist!
readelf: Warning: Section 24 was not dumped because it does not exist!

process_archive doesn't reset dump_sects after processing each
archive member. We are reusing dump_sects from the largest
dump_sects.
Comment 1 Sourceware Commits 2011-01-18 17:44:01 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2011-01-18 17:43:57

Modified files:
	binutils       : ChangeLog readelf.c 

Log message:
	Reset dump_sects after processing each archive member.
	
	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.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1737&r2=1.1738
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/readelf.c.diff?cvsroot=src&r1=1.529&r2=1.530
Comment 2 H.J. Lu 2011-01-18 17:59:33 UTC
Fixed.