PATCH: binutils/2467: "ar q" / ranlib has large memory use (linear in archive size)

H. J. Lu hjl@lucon.org
Fri Mar 24 07:27:00 GMT 2006


On Fri, Mar 24, 2006 at 11:41:39AM +1030, Alan Modra wrote:
> On Mon, Mar 20, 2006 at 06:23:03PM -0800, H. J. Lu wrote:
> > Will this patch break anything?
> 
> I don't know the answer to that, but really, it's something that you as
> patch submitter should answer.  You could gain a reasonable level of

I think it is safe. _bfd_generic_bfd_free_cached_info is called from
_bfd_compute_and_write_armap only. It has no problems with gcc build.

> confidence by allocating and scribbling on some memory after you've
> freed the objalloc.  Test it with a coff an aout target too.
> 

I added

  abfd->sections = NULL;
  abfd->section_last = NULL;
  abfd->outsymbols = NULL;
  abfd->tdata.any = NULL;
  abfd->usrdata = NULL;
  abfd->memory = NULL;

It doesn't cause any trouble. I checked i386-coff and i386-aout.


H.J.



More information about the Binutils mailing list