summaryrefslogtreecommitdiff
path: root/bfd/sysdep.h
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2013-05-27 07:55:16 +0000
committerMark Wielaard <mjw@redhat.com>2013-05-27 07:55:16 +0000
commitbc9de2b3191a2a2112f69130cf4274325251495d (patch)
treedfe677cb2484b051c16ba8d6ac36123011234a44 /bfd/sysdep.h
parente7e89a91affc920f0d422c56ca04867e49ac5ac1 (diff)
downloadbinutils-redhat-bc9de2b3191a2a2112f69130cf4274325251495d.tar.gz
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/sysdep.h')
-rw-r--r--bfd/sysdep.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/sysdep.h b/bfd/sysdep.h
index b4fed10441..d560e7670b 100644
--- a/bfd/sysdep.h
+++ b/bfd/sysdep.h
@@ -79,6 +79,10 @@ extern char *strrchr ();
#include <unistd.h>
#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif /* HAVE_SYS_RESOURCE_H */
+
#ifdef USE_BINARY_FOPEN
#include "fopen-bin.h"
#else