From bc9de2b3191a2a2112f69130cf4274325251495d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 27 May 2013 07:55:16 +0000 Subject: 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/configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bfd/configure.in') diff --git a/bfd/configure.in b/bfd/configure.in index befcf27094..ff14270fd5 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -211,7 +211,7 @@ AC_SUBST(BFD_HOSTPTR_T) BFD_CC_FOR_BUILD AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h) -AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h) +AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h) GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME AC_HEADER_DIRENT @@ -220,7 +220,7 @@ AC_CHECK_HEADERS(windows.h dlfcn.h) ACX_HEADER_STRING AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) -AC_CHECK_FUNCS(strtoull) +AC_CHECK_FUNCS(strtoull getrlimit) AC_CHECK_DECLS(basename) AC_CHECK_DECLS(ftello) -- cgit v1.2.1