This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: readelf doesn't support ELF64 on 32bit host
- To: nickc at cygnus dot com
- Subject: Re: readelf doesn't support ELF64 on 32bit host
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 2 Dec 1999 13:25:00 -0500
- CC: hjl at valinux dot com, rth at cygnus dot com, binutils at sourceware dot cygnus dot com
- References: <199912021820.SAA22244@pathia.cygnus.co.uk>
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