+2014-04-04 Tristan Gingold <gingold@adacore.com>
+
+ * bfd.c (bfd_get_arch_size): Default is taken from arch.
+
2014-04-03 Jon Turney <jon.turney@dronecode.org.uk>
* peXXigen.c (pe_print_edata): Verify edt.name lies inside
int bfd_get_arch_size (bfd *abfd);
DESCRIPTION
- Returns the architecture address size, in bits, as determined
- by the object file's format. For ELF, this information is
- included in the header.
+ Returns the normalized architecture address size, in bits, as
+ determined by the object file's format. By normalized, we mean
+ either 32 or 64. For ELF, this information is included in the
+ header. Use bfd_arch_bits_per_address for number of bits in
+ the architecture address.
RETURNS
Returns the arch size in bits if known, <<-1>> otherwise.
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) > 32 ? 64 : 32;
}
/*