This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: readelf doesn't support ELF64 on 32bit host


   Date: Thu, 2 Dec 1999 18:20:06 GMT
   From: Nick Clifton <nickc@cygnus.com>

   + /* Define a macro to print out hex values.  */
   + #if  BFD_ARCH_SIZE >= 64
   + #define PRINT_32BIT_DEC "%ld"
   + #define PRINT_64BIT_DEC "%ld"
   + #define PRINT_32BIT_HEX "0x%lx"
   + #define PRINT_64BIT_HEX "0x%lx"
   + #define PRINT_FULL_64BIT_HEX "0x%16.16lx"
   + #else
   + #define PRINT_32BIT_DEC "%ld"
   + #define PRINT_64BIT_DEC "%lld"
   + #define PRINT_32BIT_HEX "0x%lx"
   + #define PRINT_64BIT_HEX "0x%llx"
   + #define PRINT_FULL_64BIT_HEX "0x%16.16llx"
   + #endif
   + 
   + #define PRINT_ADDRESS (is_32bit_elf ? PRINT_32BIT_HEX : PRINT_64BIT_HEX)
   + #define PRINT_OFFSET  (is_32bit_elf ? PRINT_32BIT_DEC : PRINT_64BIT_DEC)

If BFD_ARCH_SIZE == 64, it's not correct to assume that %lx will print
a bfd_vma value.  You should use [fs]printf_vma instead.

Ian

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