bfd: Make bfd_cache_max_open depend on actual open file limit.
authorMark Wielaard <mjw@redhat.com>
Mon, 27 May 2013 07:55:17 +0000 (07:55 +0000)
committerMark Wielaard <mjw@redhat.com>
Mon, 27 May 2013 07:55:17 +0000 (07:55 +0000)
commit9d782e8df03087e435c045219a37311d9af174ea
tree59b3bfe6af55c820167f6f10e17575d18becbb85
parent7bd153c85818e66bb2c408375e9de8794b7ac8fa
bfd: Make bfd_cache_max_open depend on actual open file limit.

The current hard coded limit of open files in bfd/cache.c is 10. This
is pretty low these days. Binaries are often linked against much more
than 10 files (and sometimes against more than 100 shared libraries).
When debugging with GDB some files are opened and closed multiple
times because of this low limit. If possible make the BFD cache file
limit depend on the actual open file limit of the process so more BFD
files can be open at the same time.

    * cache.c (BFD_CACHE_MAX_OPEN): Remove define.
    (max_open_files): New static int initialized to zero.
    (bfd_cache_max_open): New static function to set and return
    max_open_files.
    (bfd_cache_init): Use bfd_cache_max_open.
    (bfd_open_file): Likewise.
    * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
    (AC_CHECK_FUNCS): Add getrlimit.
    * configure: Regenerated.
    * config.in: Likewise.
    * sysdep.h: Check and include sys/resource.h for getrlimit.
bfd/ChangeLog
bfd/cache.c
bfd/config.in
bfd/configure
bfd/configure.in
bfd/sysdep.h
This page took 0.026995 seconds and 4 git commands to generate.