This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch]: Fix bfd_get_arch_size for non-ELF targets
- From: Alan Modra <amodra at gmail dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: "binutils at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Thu, 3 Apr 2014 23:04:58 +1030
- Subject: Re: [Patch]: Fix bfd_get_arch_size for non-ELF targets
- Authentication-results: sourceware.org; auth=none
- References: <DD667986-BF49-448D-B70E-B9548BC540B0 at adacore dot com>
On Thu, Apr 03, 2014 at 12:09:04PM +0200, Tristan Gingold wrote:
> --- a/bfd/bfd.c
> +++ b/bfd/bfd.c
> @@ -1087,7 +1087,7 @@ bfd_get_arch_size (bfd *abfd)
> if (abfd->xvec->flavour == bfd_target_elf_flavour)
> return get_elf_backend_data (abfd)->s->arch_size;
>
> - return -1;
> + return bfd_arch_bits_per_address (abfd);
This might be better:
return bfd_arch_bits_per_address (abfd) > 32 ? 64 : 32;
On more than one target, bfd_arch_bits_per_address will return 16,
and more than one target returns 24. So your patch would mean you
need to change the test in objdump.c, and you'd break
nm.c:set_print_width.
--
Alan Modra
Australia Development Lab, IBM