aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-03-13 00:08:35 +0000
committerNick Clifton <nickc@redhat.com>2001-03-13 00:08:35 +0000
commit43a0748c7811bf542e8a9f020292a991db0bfa1a (patch)
tree21fa40220d355eaea5757edcf868e4a706770979 /bfd
parent83e7603d4f1229f246ccd2c9f5ffb61d05662243 (diff)
downloadgdb-43a0748c7811bf542e8a9f020292a991db0bfa1a.zip
gdb-43a0748c7811bf542e8a9f020292a991db0bfa1a.tar.gz
gdb-43a0748c7811bf542e8a9f020292a991db0bfa1a.tar.bz2
Add --binary-architecture switch to objcopy to allow the output architecture
to be set when the input file type is binary.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/binary.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 136fdab..99506d1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2001-03-12 Stefan Geuken <mail@stefan-geuken.de>
+
+ * binary.c (bfd_external_binary_architecture): Declare.
+ (binary_object_p): If bfd_external_binary_architecture is defined,
+ set the architecture to this string.
+
2001-03-11 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT
diff --git a/bfd/binary.c b/bfd/binary.c
index b80343b..a008f90 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -55,6 +55,10 @@ static boolean binary_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static int binary_sizeof_headers PARAMS ((bfd *, boolean));
+/* Set by external programs - specifies the BFD architecture
+ to use when creating binary BFDs. */
+enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown;
+
/* Create a binary object. Invoked via bfd_set_format. */
static boolean
@@ -101,6 +105,13 @@ binary_object_p (abfd)
abfd->tdata.any = (PTR) sec;
+ if (bfd_get_arch_info (abfd) != NULL)
+ {
+ if ((bfd_get_arch_info (abfd)->arch == bfd_arch_unknown)
+ && (bfd_external_binary_architecture != bfd_arch_unknown))
+ bfd_set_arch_info (abfd, bfd_lookup_arch (bfd_external_binary_architecture, 0));
+ }
+
return abfd->xvec;
}