This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH mingw/gold] Plugins cleanup fails on windows due to open handle
- From: Pavel Chupin <pavel dot v dot chupin at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 11 Feb 2013 14:11:27 +0400
- Subject: Re: [PATCH mingw/gold] Plugins cleanup fails on windows due to open handle
- References: <CANwJu1_vr7uyP5ao-AuZ-xOC_L6OMM1NL77w5noSkR6ZrYpZRA@mail.gmail.com> <CAKOQZ8ykZw_GeH-bYnUd3XOBETdVW=+MB7FjwOxxGXc8srqvJA@mail.gmail.com>
On Sat, Feb 9, 2013 at 5:56 AM, Ian Lance Taylor <firstname.lastname@example.org> wrote:
> On Sun, Jan 20, 2013 at 1:08 AM, Pavel Chupin <email@example.com> wrote:
>> Attached patch fixes issue with gold on windows:
>> ld.exe: fatal error: could not unlink output file
>> collect2.exe: error: ld returned 1 exit status
>> It happens on any gold link (successful or not) with plugins when
>> plugins->cleanup() called on gold_exit() tries to remove temporary
>> files (cc2lB8c4.ltrans0.ltrans.o) but handle is still opened.
>> I'm fixing it via new property close_on_release which can be setup per
>> each descriptor and therefore control any descriptor release if
> Sorry for the slow review. This approach does not look to me like a
> good idea. It will force additional unnecessary file reopens in all
> cases. You only care about input files added by the plugin, and you
> only care about them at the end of the link.
> Does this patch fix the problem?
Yes, it does fix the problem. Thanks a lot.