]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Fix ELF definitions for MIPS in local-elf.h
authorJames Cowgill <jcowgill@debian.org>
Mon, 19 Jun 2017 19:38:40 +0000 (21:38 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 24 Jun 2017 14:08:22 +0000 (16:08 +0200)
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 <guillem@hadrons.org>
src/local-elf.h

index 3abbe700d50cd800fd93459295f811fb25e30931..1faf182f87d73072efe03c2a8a6402d138148b6b 100644 (file)
 #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