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

2015-02-06 Thread H.J. Lu
On Fri, Feb 6, 2015 at 5:30 AM, H.J. Lu wrote: > On Fri, Feb 6, 2015 at 5:18 AM, Markus Trippelsdorf > wrote: >> On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: >>> On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf >>> wrote: >>> > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >>> >> >>> >> We sho

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

2015-02-06 Thread H.J. Lu
On Fri, Feb 6, 2015 at 5:18 AM, Markus Trippelsdorf wrote: > On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: >> On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf >> wrote: >> > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >> >> >> >> We should pass handle, not file, to release_input_file. >> >> I

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

2015-02-06 Thread Markus Trippelsdorf
On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: > On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf > wrote: > > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: > >> > >> We should pass handle, not file, to release_input_file. > >> I checked it in as an obvious fix. > > > > This commit causes: > > > >

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

2015-02-06 Thread H.J. Lu
On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf wrote: > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >> >> We should pass handle, not file, to release_input_file. >> I checked it in as an obvious fix. > > This commit causes: > > % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - > ld

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

2015-02-06 Thread Markus Trippelsdorf
On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: > > We should pass handle, not file, to release_input_file. > I checked it in as an obvious fix. This commit causes: % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - ld.gold: internal error in remove_writer, at token.h:132 collect2: error:

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

2015-02-05 Thread H.J. Lu
On Thu, Feb 5, 2015 at 8:42 AM, H.J. Lu wrote: > On Wed, Jan 28, 2015 at 4:02 PM, H.J. Lu wrote: >> On Wed, Jan 28, 2015 at 11:37 AM, H.J. Lu wrote: >>> On Wed, Jan 28, 2015 at 11:19 AM, Richard Biener >>> wrote: On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: >Hi, > >Thi

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

2015-02-05 Thread H.J. Lu
On Wed, Jan 28, 2015 at 4:02 PM, H.J. Lu wrote: > On Wed, Jan 28, 2015 at 11:37 AM, H.J. Lu wrote: >> On Wed, Jan 28, 2015 at 11:19 AM, Richard Biener >> wrote: >>> On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: Hi, This patch makes claim_file_handler to call release_input_fi

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

2015-02-04 Thread H.J. Lu
On Wed, Feb 4, 2015 at 7:35 AM, Cary Coutant 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 leakin

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

2015-02-04 Thread Cary Coutant
>>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

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

2015-02-04 Thread Richard Biener
On February 4, 2015 5:49:13 AM CET, Cary Coutant wrote: >The plugin is not supposed to call release_input_file from the >claim_file handler. That interface is only for releasing a file >descriptor obtained via get_input_file during the all_symbols_read >callback. When the linker calls the claim_fi

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

2015-02-03 Thread Cary Coutant
The plugin is not supposed to call release_input_file from the claim_file handler. That interface is only for releasing a file descriptor obtained via get_input_file during the all_symbols_read callback. When the linker calls the claim_file handler, the file descriptor is open, and the plugin is re

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

2015-01-28 Thread H.J. Lu
On Wed, Jan 28, 2015 at 11:37 AM, H.J. Lu wrote: > On Wed, Jan 28, 2015 at 11:19 AM, Richard Biener > wrote: >> On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: >>>Hi, >>> >>>This patch makes claim_file_handler to call release_input_file after it >>>finishes processing input file. OK for tr

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

2015-01-28 Thread H.J. Lu
On Wed, Jan 28, 2015 at 11:44 AM, Cary Coutant wrote: This patch makes claim_file_handler to call release_input_file after it finishes processing input file. OK for trunk? >>> >>> OK. How did you test this? >> >> I did normal bootstrap and "make check" on Linux/x86-64. >> I also run ld.b

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

2015-01-28 Thread Cary Coutant
>>>This patch makes claim_file_handler to call release_input_file after it >>>finishes processing input file. OK for trunk? >> >> OK. How did you test this? > > I did normal bootstrap and "make check" on Linux/x86-64. > I also run ld.bfd and ld.gold by hand to verify that release_input_file > is

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

2015-01-28 Thread H.J. Lu
On Wed, Jan 28, 2015 at 11:19 AM, Richard Biener wrote: > On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: >>Hi, >> >>This patch makes claim_file_handler to call release_input_file after it >>finishes processing input file. OK for trunk? > > OK. How did you test this? I did normal bootstra

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

2015-01-28 Thread Richard Biener
On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: >Hi, > >This patch makes claim_file_handler to call release_input_file after it >finishes processing input file. OK for trunk? OK. How did you test this? Thanks, Richard. >Thanks. > > >H.J. >--- >diff --git a/lto-plugin/ChangeLog b/lto-plu

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

2015-01-28 Thread H.J. Lu
Hi, This patch makes claim_file_handler to call release_input_file after it finishes processing input file. OK for trunk? Thanks. H.J. --- diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog index e8ec05b..c0eae24 100644 --- a/lto-plugin/ChangeLog +++ b/lto-plugin/ChangeLog @@ -1,3 +1,10