public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Patch]: Fix bfd_get_arch_size for non-ELF targets
@ 2014-04-03 10:09 Tristan Gingold
  2014-04-03 12:35 ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: Tristan Gingold @ 2014-04-03 10:09 UTC (permalink / raw)
  To: binutils@sourceware.org Development

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-04 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-03 10:09 [Patch]: Fix bfd_get_arch_size for non-ELF targets Tristan Gingold
2014-04-03 12:35 ` Alan Modra
2014-04-03 12:48   ` Tristan Gingold
2014-04-03 23:17     ` Alan Modra
2014-04-04 12:20       ` Tristan Gingold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).