diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2009-11-16 11:12:37 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2009-11-16 11:12:37 +0000 |
commit | 4f379c7d63d2ba866da45096bf53fc69c11fb6bf (patch) | |
tree | 1fdff6eb1c11ca98623c456ccc1e9b087e9d591e /binutils/windmc.c | |
parent | 84f3c95d5de17f9579e5ac3b0a7e1d91b0835228 (diff) | |
download | binutils-redhat-4f379c7d63d2ba866da45096bf53fc69c11fb6bf.tar.gz |
2009-11-16 Kai Tietz <kai.tietz@onevision.com>
* windmc.c (set_endianess): Use bfd_get_target_info.
* windres.c (set_endianess): Likewise.
(find_arch_match): Removed.
Diffstat (limited to 'binutils/windmc.c')
-rw-r--r-- | binutils/windmc.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/binutils/windmc.c b/binutils/windmc.c index d02bc865a2..63db990594 100644 --- a/binutils/windmc.c +++ b/binutils/windmc.c @@ -236,42 +236,12 @@ set_endianess (bfd *abfd, const char *target) const bfd_target *target_vec; def_target_arch = NULL; - target_vec = bfd_find_target (target, abfd); + target_vec = bfd_get_target_info (target, abfd, &target_is_bigendian, NULL, + &def_target_arch); if (! target_vec) fatal ("Can't detect target endianess and architecture."); - target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0); - - { - const char * tname = target_vec->name; - const char ** arches = bfd_arch_list (); - - if (arches && tname) - { - const char ** arch = arches; - - if (strchr (tname, '-') != NULL) - tname = strchr (tname, '-') + 1; - - while (*arch != NULL) - { - const char *in_a = strstr (*arch, tname); - char end_ch = (in_a ? in_a[strlen (tname)] : 0); - - if (in_a && (in_a == *arch || in_a[-1] == ':') - && end_ch == 0) - { - def_target_arch = *arch; - break; - } - arch++; - } - } - - free (arches); - - if (! def_target_arch) - fatal ("Can't detect architecture."); - } + if (! def_target_arch) + fatal ("Can't detect architecture."); } static int |