From 3ba522fed3d34f476090da9349be96e15e0652cb Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Tue, 14 Dec 2010 15:12:47 -0800 Subject: Fix build for x86_64 Some ELF-related variables differ depending on the native host, so this patch uses conditional compilation tricks to ensure everything works out on both 32- and 64-bit hosts. Signed-off-by: Zachary T Welch --- ltrace-elf.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ltrace-elf.h') diff --git a/ltrace-elf.h b/ltrace-elf.h index 37f2a18..a29fe2c 100644 --- a/ltrace-elf.h +++ b/ltrace-elf.h @@ -51,4 +51,13 @@ extern GElf_Addr arch_plt_sym_val(struct ltelf *, size_t, GElf_Rela *); #ifndef SHT_GNU_HASH #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ #endif + +#if __WORDSIZE == 32 +#define PRI_ELF_ADDR PRIx32 +#define GELF_ADDR_CAST(x) (void *)(uint32_t)(x) +#else +#define PRI_ELF_ADDR PRIx64 +#define GELF_ADDR_CAST(x) (void *)(x) +#endif + #endif -- cgit v1.2.3