https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64837
Bug ID: 64837
Summary: lto plugun doesn't call ld_plugin_release_input_file
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: ccoutant at gcc dot gnu.org
Since lto plugin doesn't call ld_plugin_release_input_file,
plugin_maybe_claim in ld/plugin.c does
/* fd belongs to us, not the plugin; but we don't need it. */
close (file->fd);
It may not work for other plugins, like LLVM plugin. It
may also leak file descriptor when gold is used.