This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch]: Fix bfd_get_arch_size for non-ELF targets
- From: Tristan Gingold <gingold at adacore dot com>
- To: "binutils at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Thu, 3 Apr 2014 12:09:04 +0200
- Subject: [Patch]: Fix bfd_get_arch_size for non-ELF targets
- Authentication-results: sourceware.org; auth=none
Hello,
currently bfd_get_arch_size always returns -1 on non-ELF targets. One visible consequence is
the output of objdump -h: the headline is printed for 64 bit vma, even if the vma are 32 bit wide
(and printed using 8 chars).
With this patch, bfd_get_arch_size returns bfd_arch_bits_per_address on non-ELF targets.
I don't know if it is necessary to handle ELF differently here. It's already the case for
is32bit.
Ok for trunk ?
Tristan.
bfd/
* bfd.c (bfd_get_arch_size): Default is taken from arch.
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 6b00592..512abc4 100644
--- 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);
}
/*