This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR lto/64837: lto plugin doesn't call ld_plugin_release_input_file


On Wed, Feb 4, 2015 at 7:35 AM, Cary Coutant <ccoutant@google.com> wrote:
>>>If you're going to insist on calling the release_input_file API from
>>>the claim_file handler, I'm going to have to fix gold to ignore the
>>>call to avoid a premature unlock of the object file.
>>
>> What's the proper solution for not leaking those filedescriptors?
>
> There was a bug in gold where it wasn't unlocking external members of
> thin archives that got claimed by the plugin. See PR 15660:
>
>    https://sourceware.org/bugzilla/show_bug.cgi?id=15660
>

FWIW, ld doesn't have the file descriptor leak since it does

  /* fd belongs to us, not the plugin; but we don't need it.  */
  close (file->fd);

after calling claim_file_handler.  It only works with GCC plug-in
library.  I going to change it:

https://sourceware.org/ml/binutils/2015-02/msg00001.html


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]