[Bug binutils/2467] "ar q" / ranlib has large memory use (linear in archive size)

2006-03-20 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 16:25 --- The reason that bfd_free_cached_info does nothing is because on elf targets it is #defined to be _bfd_generic_bfd_free_cached_info which is #defined to be bfd_true. As a complete hack I tried calling this

[Bug binutils/2467] "ar q" / ranlib has large memory use (linear in archive size)

2006-03-17 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 18:41 --- Created an attachment (id=926) --> (http://sourceware.org/bugzilla/attachment.cgi?id=926&action=view) Possible patch to make _bfd_generic_bfd_free_cached_info effective Just to be concrete, here's

[Bug binutils/2467] "ar q" / ranlib has large memory use (linear in archive size)

2006-03-17 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 17:15 --- To try and make this patch less of a hack I tried this: add a new _bfd_generic_bfd_free_cached_info and in libbfd.h change the #define _bfd_generic_bfd_free_cached_info bfd_true to a proper prototype

[Bug binutils/2467] "ar q" / ranlib has large memory use (linear in archive size)

2006-03-17 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 15:18 --- After looking at the code a bit more I have these observations: as we map over each element in the archive, it is the call to: bfd_check_format (current, bfd_object); that makes the current bfd swell in memory

[Bug binutils/2467] "ar q" / ranlib has large memory use (linear in archive size)

2006-03-17 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 12:33 --- Changing summary to be more accurate. The quadratic thing is a misleading since we only get that behaviour with xargs (where we're basically running ranlib a linear number of times on an archive that is gr

[Bug binutils/2467] "ar q" gives quadratic memory use

2006-03-16 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 03:08 --- Interestingly, this bit has no noticable effect on memory use. /* Now ask the BFD to free up any cached information, so we don't fill all of memory with symbol tables. */

[Bug binutils/2467] "ar q" gives quadratic memory use

2006-03-16 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 02:57 --- Adding some instrumantation shows that the spike in memory use occurs within the function _bfd_compute_and_write_armap() in bfd's archive.c module. It maps over each object file in the archive and allo

[Bug binutils/2467] "ar q" gives quadratic memory use

2006-03-16 Thread dcoutts at gentoo dot org
--- Additional Comments From dcoutts at gentoo dot org 2006-03-17 00:46 --- I tried using the 'S' modifier which did make adding archive members faster (by not building the symbol index). However it also missed members out for some reason which I have not figured out yet. Fur

[Bug binutils/2467] New: "ar q" gives quadratic memory use

2006-03-16 Thread dcoutts at gentoo dot org
uild large archives on weaker machines. -- Summary: "ar q" gives quadratic memory use Product: binutils Version: 2.16 Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassi