[v4,22/35] libctf: bfd-open: mark the bfd as cacheable

Message ID 20190924135131.441906-23-nick.alcock@oracle.com
State New
Headers show
Series
  • CTF linking support
Related show

Commit Message

Nick Alcock Sept. 24, 2019, 1:51 p.m.
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/ctf-open-bfd.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.23.0.239.g28aa4420fd

Patch

diff --git a/libctf/ctf-open-bfd.c b/libctf/ctf-open-bfd.c
index 1e0fe235e86..da62463c35f 100644
--- a/libctf/ctf-open-bfd.c
+++ b/libctf/ctf-open-bfd.c
@@ -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))
     {