libctf: bfd-open: mark the bfd as cacheable
authorNick Alcock <nick.alcock@oracle.com>
Fri, 26 Jul 2019 20:52:11 +0000 (21:52 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 3 Oct 2019 16:04:55 +0000 (17:04 +0100)
Without this, the FD is only closed when the CTF file is, leading to
running out of fds on (e.g.) very large links.

New in v3.

libctf/
* ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.

libctf/ChangeLog
libctf/ctf-open-bfd.c

index 9637cf37af9daa1197232b3df28ca66cac7188ee..852ad6267c3636e28148cd63a286517335ddd4ed 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-30  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.
+
 2019-07-13  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-impl.h (includes): Include <sys/param.h> here.
index 6fbbde88529b333fe2abe01602d9795893a126b7..1083c8760856d262e7f73a61e2203aa28e9486ea 100644 (file)
@@ -312,6 +312,7 @@ ctf_fdopen (int fd, const char *filename, const char *target, int *errp)
                   bfd_errmsg (bfd_get_error()));
       return (ctf_set_open_errno (errp, ECTF_FMT));
     }
+  bfd_set_cacheable (abfd, 1);
 
   if (!bfd_check_format (abfd, bfd_object))
     {