diff options
author | Mark Wielaard <mjw@redhat.com> | 2013-05-27 07:55:17 +0000 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2013-05-27 07:55:17 +0000 |
commit | 9d782e8df03087e435c045219a37311d9af174ea (patch) | |
tree | 59b3bfe6af55c820167f6f10e17575d18becbb85 /bfd/configure | |
parent | 7bd153c85818e66bb2c408375e9de8794b7ac8fa (diff) | |
download | binutils-9d782e8df03087e435c045219a37311d9af174ea.zip binutils-9d782e8df03087e435c045219a37311d9af174ea.tar.gz binutils-9d782e8df03087e435c045219a37311d9af174ea.tar.bz2 |
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.
Diffstat (limited to 'bfd/configure')
-rwxr-xr-x | bfd/configure | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/configure b/bfd/configure index 5fc08e4..090f981 100755 --- a/bfd/configure +++ b/bfd/configure @@ -12908,7 +12908,7 @@ fi done -for ac_header in fcntl.h sys/file.h sys/time.h sys/stat.h +for ac_header in fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -13583,12 +13583,14 @@ _ACEOF fi done -for ac_func in strtoull +for ac_func in strtoull getrlimit do : - ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" -if test "x$ac_cv_func_strtoull" = x""yes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOULL 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi |