[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/23460] regression: ar can not create archive containing m
From: |
zenith432 at users dot sourceforge.net |
Subject: |
[Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files |
Date: |
Thu, 16 Aug 2018 10:01:10 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=23460
--- Comment #15 from zenith432 at users dot sourceforge.net ---
(In reply to Evangelos Foutras from comment #14)
> I believe the above error is caused by a sequence of "dlopen -> dlclose ->
> dlopen" on LLVMgold.so. (liblto_plugin.so doesn't seem to mind being
> unloaded and loaded again.)
>
> Is the repeated dlopen expected here?
Yes, because bfd/plugin.c unloads the plugin on any input file that is not
claimed by the plugin.
I propose the following change
===== begin patch
diff --git a/bfd/plugin.c b/bfd/plugin.c
index d9b9e2f1..3b738c38 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -274,7 +274,7 @@ have_claim_file:
goto err;
if (!try_claim (abfd))
- goto err;
+ return 0;
abfd->plugin_format = bfd_plugin_yes;
===== end patch
On a different subject, since you're submitting commits to llvm, could you
please fix the design flaw in llvm plugin described in Comment #5? It uses the
file descriptor fd passed to claim_file_hook() as a uniqueness-detector to
determine which input files are found in the same archive. This is a no-no
because the plugin API disallows using the fd passed to claim_file_hook() after
it returns. It is essential that the plugin client be free to reuse file
descriptors for input files because there may be more input files than open
descriptors allowed by the kernel.
The plugin should not really have to detect whether input files come from the
same archive, but if it must should use some other method such as...
1) Use the filename instead of descriptor as a unique key.
2) do fstat() on the file descriptor and use a <device_id,inode> pair as a
unique key.
Thanks.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, cvs-commit at gcc dot gnu.org, 2018/08/01
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/01
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, cvs-commit at gcc dot gnu.org, 2018/08/02
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, evangelos at foutrelis dot com, 2018/08/07
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, mgorny at gentoo dot org, 2018/08/12
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/14
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, mgorny at gentoo dot org, 2018/08/14
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/14
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, evangelos at foutrelis dot com, 2018/08/14
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files,
zenith432 at users dot sourceforge.net <=
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, evangelos at foutrelis dot com, 2018/08/16
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/17
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, amodra at gmail dot com, 2018/08/17
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, evangelos at foutrelis dot com, 2018/08/17
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, zenith432 at users dot sourceforge.net, 2018/08/17
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, zenith432 at users dot sourceforge.net, 2018/08/17
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/21
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, zenith432 at users dot sourceforge.net, 2018/08/21
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, cvs-commit at gcc dot gnu.org, 2018/08/23
- [Bug binutils/23460] regression: ar can not create archive containing many (>1024) lto object files, nickc at redhat dot com, 2018/08/23