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]

[Patch]: Fix bfd_get_arch_size for non-ELF targets


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);
 }
 
 /*


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