This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
objcopy -B (--binary-architecture=)bfdarch limited to 'binary' input
- From: Philippe De Muyter <phdm at macqel dot be>
- To: binutils at sourceware dot org
- Date: Mon, 24 Aug 2009 15:49:41 +0200
- Subject: objcopy -B (--binary-architecture=)bfdarch limited to 'binary' input
Hello list,
I recently tried to use
objcopy -I srec -B m68k ...
to produce a elf file, but got this warning :
objcopy: Warning: input target 'binary' required for binary architecture parameter.
objcopy: Argument m68k ignored
I see no reason why converting from srec (and other architecture-less formats)
could not benefit also from the -B option.
Here is a patch squetch :
binutils/Changelog
2009-08-24 Philippe De Muyter <phdm@macqel.be>
* obcopy.c (copy_main): Accept `-B' (`--binary-architecture') option
also for 'srec' input.
Index: binutils/objcopy.c
===================================================================
RCS file: /cvs/src/src/binutils/objcopy.c,v
retrieving revision 1.134
diff -p -U6 -r1.134 objcopy.c
--- binutils/objcopy.c 3 Aug 2009 13:47:35 -0000 1.134
+++ binutils/objcopy.c 24 Aug 2009 13:44:26 -0000
@@ -3822,13 +3822,15 @@ copy_main (int argc, char *argv[])
output_target = efi;
convert_efi_target (efi);
}
if (binary_architecture != NULL)
{
- if (input_target && strcmp (input_target, "binary") == 0)
+ if (input_target
+ && (strcmp (input_target, "binary") == 0
+ || strcmp (input_target, "srec") == 0))
{
const bfd_arch_info_type * temp_arch_info;
temp_arch_info = bfd_scan_arch (binary_architecture);
if (temp_arch_info != NULL)
@@ -3838,13 +3840,13 @@ copy_main (int argc, char *argv[])
}
else
fatal (_("architecture %s unknown"), binary_architecture);
}
else
{
- non_fatal (_("Warning: input target 'binary' required for binary architecture parameter."));
+ non_fatal (_("Warning: input target 'binary|srec' required for binary architecture parameter."));
non_fatal (_(" Argument %s ignored"), binary_architecture);
}
}
if (preserve_dates)
if (stat (input_filename, & statbuf) < 0)
comments ?
Philippe