This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR lto/64837: lto plugin doesn't call ld_plugin_release_input_file
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Feb 2015 07:52:14 -0800
- Subject: Re: PR lto/64837: lto plugin doesn't call ld_plugin_release_input_file
- Authentication-results: sourceware.org; auth=none
- References: <20150128181242 dot GA4350 at intel dot com> <DC893389-7AE0-45DA-A65B-124426D91CF3 at gmail dot com> <CAMe9rOqxNUzhanCShsgfLsqj_QJibroQZrF+g4y8c=XQxZnd8A at mail dot gmail dot com> <CAMe9rOpMWxMRHfmS=9kio+V5XAjEMFfnHo3xDPg5wegVXdj9MQ at mail dot gmail dot com> <CAHACq4ojorbkupCeo_r08hmTCKd0RNjBtcZ9LZd3zCSCdw4ZFw at mail dot gmail dot com> <2345F670-CB5A-4924-8D53-91F3259F2BF6 at gmail dot com> <CAHACq4r27LSLP62h0UbP2_B8iNpwQ+4X_ibbx0pwSM9UoffHZg at mail dot gmail dot com>
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.