[PATCH mingw/gold] Plugins cleanup fails on windows due to open handle

Ian Lance Taylor iant@google.com
Sat Feb 9 01:56:00 GMT 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: application/octet-stream
Size: 3020 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20130209/f10d2f3d/attachment.obj>


More information about the Binutils mailing list