From: James Cowgill Date: Mon, 19 Jun 2017 19:38:40 +0000 (+0200) Subject: Fix ELF definitions for MIPS in local-elf.h X-Git-Tag: 0.8.5~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b480b7a3f81cf49b9f3f0f8cdd20b33999aa7530;p=thirdparty%2Flibbsd.git Fix ELF definitions for MIPS in local-elf.h Add a check for _MIPS_SIM inside the __mips__ #elif to detect mips64el and use ELFCLASS64 in that case. Note that we can't use defined(__mips64) here because that is also defined when the n32 ABI is in use, which uses ELFCLASS32. Fixes: https://bugs.debian.org/865091 Signed-off-by: Guillem Jover --- diff --git a/src/local-elf.h b/src/local-elf.h index 3abbe70..1faf182 100644 --- a/src/local-elf.h +++ b/src/local-elf.h @@ -127,7 +127,11 @@ #elif defined(__mips__) #define ELF_TARG_MACH EM_MIPS +#if defined(_ABI64) && _MIPS_SIM == _ABI64 +#define ELF_TARG_CLASS ELFCLASS64 +#else #define ELF_TARG_CLASS ELFCLASS32 +#endif #if defined(__MIPSEB__) #define ELF_TARG_DATA ELFDATA2MSB #else