Test for 32/64 bit object file?

Ian Lance Taylor ian@zembu.com
Tue Nov 16 13:08:00 GMT 1999


   Date: Wed, 17 Nov 1999 07:20:16 +1100
   From: Andrew Cagney <ac131313@cygnus.com>

   Is there a way of determining if an object file is 32 or 64 bit?  (eg
   elf32/elf64, aout32 vs aout64).

Why do you want to know?  I don't mean to be snide; it's just that
that distinction usually isn't interesting.

   Perhaphs bfd_arch_bits_per_address(ABFD) is correct?

That will tell you whether the CPU uses 32 bits in an address or 64
bits in an address.  It's not the same as elf32 vs. elf64, but it may
be what you need to know.

Ian


More information about the Binutils mailing list