[PATCH mingw/gold] Plugins cleanup fails on windows due to open handle
Pavel Chupin
pavel.v.chupin@gmail.com
Mon Feb 11 10:11:00 GMT 2013
On Sat, Feb 9, 2013 at 5:56 AM, Ian Lance Taylor <iant@google.com> wrote:
> On Sun, Jan 20, 2013 at 1:08 AM, Pavel Chupin <pavel.v.chupin@gmail.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
>> needed.
>
> 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?
>
> Ian
Hi Ian,
Yes, it does fix the problem. Thanks a lot.
--
Pavel Chupin
Intel Corporation
More information about the Binutils
mailing list