Go to file
H.J. Lu 9181724704 ld: Cache and reuse the IR archive file descriptor
Linker plugin_object_p opens the IR archive for each IR archive member.
For GCC plugin, plugin_object_p closes the archive file descriptor.  But
for LLVM plugin, the archive file descriptor remains open.  If there are
3000 IR archive members, there are 3000 file descriptors for them.  We
can run out of file descriptors petty easily.

1. Add archive_plugin_fd and archive_plugin_fd_open_count to bfd so that
we can cache and reuse the IR archive file descriptor for all IR archive
members in the archive.
2. Add bfd_plugin_close_file_descriptor to properly close the IR archive
file descriptor.

bfd/

	PR ld/28040
	* archive.c (_bfd_archive_close_and_cleanup): Close the archive
	plugin file descriptor if needed.
	* bfd.c (bfd): Add archive_plugin_fd and
	archive_plugin_fd_open_count.
	* opncls.c (_bfd_new_bfd): Initialize to -1.
	* plugin.c (bfd_plugin_open_input): Cache and reuse the archive
	plugin file descriptor.
	(bfd_plugin_close_file_descriptor): New function.
	(try_claim): Call bfd_plugin_close_file_descriptor.
	* plugin.h (bfd_plugin_close_file_descriptor): New.
	* bfd-in2.h: Regenerated.

ld/

	PR ld/28040
	* plugin.c (plugin_input_file): Add ibfd.
	(release_plugin_file_descriptor): New function.
	(release_input_file): Call release_plugin_file_descriptor to
	close input->fd.
	(plugin_object_p): Call release_plugin_file_descriptor to close
	input->fd.  Also call release_plugin_file_descriptor if not
	claimed.
	* testsuite/config/default.exp (RANLIB): New.
	* testsuite/ld-plugin/lto.exp: Run ranlib test.
2021-07-05 08:51:35 -07:00
bfd ld: Cache and reuse the IR archive file descriptor 2021-07-05 08:51:35 -07:00
binutils Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch. 2021-07-05 15:54:35 +01:00
config Add markers for 2.37 branch 2021-07-03 14:50:57 +01:00
contrib
cpu Re: opcodes: constify & local meps macros 2021-07-05 21:40:49 +09:30
elfcpp Add markers for 2.37 branch 2021-07-03 14:50:57 +01:00
etc
gas Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch. 2021-07-05 15:54:35 +01:00
gdb [gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7 2021-07-05 16:26:42 +02:00
gdbserver gdbsupport/common.m4: check for sigtimedwait 2021-07-05 09:54:35 -04:00
gdbsupport gdb: fall back on sigpending + sigwait if sigtimedwait is not available 2021-07-05 09:54:58 -04:00
gnulib
gold Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch. 2021-07-05 15:54:35 +01:00
gprof Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch. 2021-07-05 15:54:35 +01:00
include Add markers for 2.37 branch 2021-07-03 14:50:57 +01:00
intl
ld ld: Cache and reuse the IR archive file descriptor 2021-07-05 08:51:35 -07:00
libctf Add markers for 2.37 branch 2021-07-03 14:50:57 +01:00
libdecnumber
libiberty Restore the libiberty component of commit 50ad1254d5. 2021-07-05 16:21:42 +01:00
opcodes Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch. 2021-07-05 15:54:35 +01:00
readline
sim sim: unify reserved instruction bits settings 2021-07-01 20:53:00 -04:00
texinfo
zlib
.cvsignore
.gitattributes
.gitignore
ar-lib
ChangeLog Add markers for 2.37 branch 2021-07-03 14:50:57 +01:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.