From: Nick Alcock Date: Fri, 26 Jul 2019 20:52:11 +0000 (+0100) Subject: libctf: bfd-open: mark the bfd as cacheable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fba72c8c05c56493fc78a4328b4969b9f136ee0c;p=thirdparty%2Fbinutils-gdb.git libctf: bfd-open: mark the bfd as cacheable 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. --- diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 12af4d78bcb..335cdc58f4b 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,7 @@ +2019-07-30 Nick Alcock + + * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable. + 2019-07-13 Nick Alcock * ctf-impl.h (includes): Include here. 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)) {