This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: Fix bfd_get_arch_size for non-ELF targets


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]