From 3aabb58d126445092dca953223c1730d975491dc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 13 Dec 2015 23:52:24 +0100 Subject: utlis/ldd: Fix host ldd in case of target wordsize differs from host one improved solution from http://freetz.org/ticket/842 Signed-off-by: Leonid Lisovskiy Signed-off-by: Waldemar Brodkorb --- utils/porting.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils/porting.h') diff --git a/utils/porting.h b/utils/porting.h index f1fdc70aa..f83074111 100644 --- a/utils/porting.h +++ b/utils/porting.h @@ -41,6 +41,16 @@ #include "dl-defs.h" #endif +/* __WORDSIZE ist used for __ELF_NATIVE_CLASS, which is used for ElfW(). + We want to provide the wordsize of the target, not of the host, when + compiling readelf.host + */ +#include +#ifdef ARCH_NATIVE_BIT +#undef __WORDSIZE +#define __WORDSIZE ARCH_NATIVE_BIT +#endif + #ifdef DMALLOC #include #endif -- cgit v1.2.3