Commit 4cc20e23 authored by James Cowgill's avatar James Cowgill Committed by Guillem Jover

Fix ELF definitions for PowerPC in local-elf.h

* ppc64el defines both __powerpc__ and __powerpc64__ but since the
  __powerpc64__ #elif is below the __powerpc__ one, it will never be hit.
* Both assumed that powerpc* was big-endian.

Fixes: https://bugs.debian.org/865091Signed-off-by: Guillem Jover's avatarGuillem Jover <guillem@hadrons.org>
parent c4e58c09
......@@ -140,17 +140,29 @@
#define ELF_TARG_CLASS ELFCLASS32
#define ELF_TARG_DATA ELFDATA2LSB
#elif defined(__powerpc__)
#define ELF_TARG_MACH EM_PPC
#define ELF_TARG_CLASS ELFCLASS32
#define ELF_TARG_DATA ELFDATA2MSB
#elif defined(__powerpc64__)
#define ELF_TARG_MACH EM_PPC64
#define ELF_TARG_CLASS ELFCLASS64
#if defined(__LITTLE_ENDIAN__)
#define ELF_TARG_DATA ELFDATA2LSB
#elif defined(__BIG_ENDIAN__)
#define ELF_TARG_DATA ELFDATA2MSB
#else
#error Unknown PowerPC64 endianness
#endif
#elif defined(__powerpc__)
#define ELF_TARG_MACH EM_PPC
#define ELF_TARG_CLASS ELFCLASS32
#if defined(__LITTLE_ENDIAN__)
#define ELF_TARG_DATA ELFDATA2LSB
#elif defined(__BIG_ENDIAN__)
#define ELF_TARG_DATA ELFDATA2MSB
#else
#error Unknown PowerPC endianness
#endif
#elif defined(__riscv)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment