aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-10-21 14:08:12 +0000
committerNick Clifton <nickc@redhat.com>2003-10-21 14:08:12 +0000
commitb749473bc4c4e05436f3b07d464b0a172af761cf (patch)
tree8391b9890e176efe82354c4a1969de9f3ee968c4 /binutils/objcopy.c
parent3e602632663c14cea25d8b12d1306eccbc1c9be3 (diff)
downloadgdb-b749473bc4c4e05436f3b07d464b0a172af761cf.zip
gdb-b749473bc4c4e05436f3b07d464b0a172af761cf.tar.gz
gdb-b749473bc4c4e05436f3b07d464b0a172af761cf.tar.bz2
Set the machine number as well as the architecture when converting from a
binary file to another file type.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index c651221..b48b84f 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -351,8 +351,10 @@ extern unsigned int Chunk;
on by the --srec-forceS3 command line switch. */
extern bfd_boolean S3Forced;
-/* Defined in bfd/binary.c. Used to set architecture of input binary files. */
-extern enum bfd_architecture bfd_external_binary_architecture;
+/* Defined in bfd/binary.c. Used to set architecture and machine of input
+ binary files. */
+extern enum bfd_architecture bfd_external_binary_architecture;
+extern unsigned long bfd_external_machine;
/* Forward declarations. */
static void setup_section (bfd *, asection *, void *);
@@ -2769,7 +2771,10 @@ copy_main (int argc, char *argv[])
temp_arch_info = bfd_scan_arch (binary_architecture);
if (temp_arch_info != NULL)
- bfd_external_binary_architecture = temp_arch_info->arch;
+ {
+ bfd_external_binary_architecture = temp_arch_info->arch;
+ bfd_external_machine = temp_arch_info->mach;
+ }
else
fatal (_("architecture %s unknown"), binary_architecture);
}