objcopy/strip of IR files and is_strip_input

This tidies objcopy/strip handling of IR objects, in the process of
removing the unnecessary is_strip_input flag.

The first thing I noticed when looking at is_strip_input code was that
the abfd->my_archive test in bfd_check_format_matches meant that
plugins were disabled when reading archive elements.  We can instead
disable plugins by setting bfd_no_plugin, so there doesn't seem to be
a need for is_strip_input in objcopy.c:copy_archive.  This isn't
exactly the same, because bfd_no_plugin prevents the plugin target
recognising archive elements in the bfd_check_format_matches loop over
all targets as well as just the first !target_defaulted test.  But
that turns out to be fine.  IR code is handled in copy_archive as for
other unknown format files.  In fact, the only need for the plugin
target when copying archives is when reading symbols for the archive
map.  I've made that plain by moving the plugin target override and
commenting on why it is really needed.

So on to plain object files.  Here, IR code is also copied unchanged,
so there doesn't seem a need for the plugin target there either.  It
isn't quite so simple though, because the objcopy/strip code handling
object files wants to verify the format of the object file.  Allowing
objcopy/strip to copy unknown format files would be a change in
behaviour (and results in mmix testsuite fails, ld-mmix/b-badfil1 and
others).  However, always excluding the plugin target results in a
fail of tests added in commit c2729c37f10a.  So I've enabled a plugin
format check only for files that are otherwise unrecognised, and
commented why this is done.  I question the need to objcopy LLVM
bytecode files.

bfd/
	* bfd.c (struct bfd<is_strip_input>): Delete.
	* format.c (bfd_check_format_matches): Delete is_strip_input
	special case code.
	* bfd-in2.h: Regenerate.
binutils/
	* objcopy.c (copy_archive): Don't set is_strip_input.  Always
	set bfd_plugin_no when reading elements.  Enable plugins when
	opening copied elements.
	(check_format_object): Delete.
	(copy_file): Don't enable plugin target here.  Don't set
	is_strip_input.  Set bfd_plugin_no.  Move bfd_core handling
	code earlier to remove goto.  Enable plugin for llvm bytecode.
	Copy slim IR files as unknown objects.
4 files changed