--- 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
--- 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
--- 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
--- 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
--- 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
--- 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. */
--- 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
--- 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
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