forked from Imagelibrary/binutils-gdb
Do not copy the object if the output file's format cannot be set to that of
the input file. If the input file's format is unknown, fail.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2003-12-04 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* objcopy.c (copy_object): Do not copy the object if the
|
||||||
|
output file's format cannot be set to that of the input file.
|
||||||
|
If the input file's format is unknown, fail.
|
||||||
|
|
||||||
2003-11-28 Ian Lance Taylor <ian@wasabisystems.com>
|
2003-11-28 Ian Lance Taylor <ian@wasabisystems.com>
|
||||||
|
|
||||||
* cxxfilt.c (usage): Mention new -p/--no-params options.
|
* cxxfilt.c (usage): Mention new -p/--no-params options.
|
||||||
|
|||||||
@@ -1138,9 +1138,19 @@ copy_object (bfd *ibfd, bfd *obfd)
|
|||||||
if (!bfd_set_arch_mach (obfd, iarch, imach)
|
if (!bfd_set_arch_mach (obfd, iarch, imach)
|
||||||
&& (ibfd->target_defaulted
|
&& (ibfd->target_defaulted
|
||||||
|| bfd_get_arch (ibfd) != bfd_get_arch (obfd)))
|
|| bfd_get_arch (ibfd) != bfd_get_arch (obfd)))
|
||||||
|
{
|
||||||
|
if (bfd_get_arch (ibfd) == bfd_arch_unknown)
|
||||||
|
fatal (_("Unable to recognise the format of the input file %s"),
|
||||||
|
bfd_get_filename (ibfd));
|
||||||
|
else
|
||||||
|
{
|
||||||
non_fatal (_("Warning: Output file cannot represent architecture %s"),
|
non_fatal (_("Warning: Output file cannot represent architecture %s"),
|
||||||
bfd_printable_arch_mach (bfd_get_arch (ibfd),
|
bfd_printable_arch_mach (bfd_get_arch (ibfd),
|
||||||
bfd_get_mach (ibfd)));
|
bfd_get_mach (ibfd)));
|
||||||
|
status = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!bfd_set_format (obfd, bfd_get_format (ibfd)))
|
if (!bfd_set_format (obfd, bfd_get_format (ibfd)))
|
||||||
RETURN_NONFATAL (bfd_get_filename (ibfd));
|
RETURN_NONFATAL (bfd_get_filename (ibfd));
|
||||||
|
|||||||
Reference in New Issue
Block a user