From: Guillem Jover Date: Wed, 8 Feb 2017 00:49:48 +0000 (+0100) Subject: Add support for RISC-V X-Git-Tag: 0.8.4~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=088f147ec8e55b760cf631a09d5defb332e7e9c7;p=thirdparty%2Flibbsd.git Add support for RISC-V --- diff --git a/src/local-elf.h b/src/local-elf.h index 03ebf62..84a6540 100644 --- a/src/local-elf.h +++ b/src/local-elf.h @@ -152,6 +152,18 @@ #define ELF_TARG_CLASS ELFCLASS64 #define ELF_TARG_DATA ELFDATA2MSB +#elif defined(__riscv) + +#define ELF_TARG_MACH EM_RISCV +#if __riscv_xlen == 32 +#define ELF_TARG_CLASS ELFCLASS32 +#elif __riscv_xlen == 64 +#define ELF_TARG_CLASS ELFCLASS64 +#else +#error Unsupported ELF class +#endif +#define ELF_TARG_DATA ELFDATA2LSB + #elif defined(__sparc__) #if defined(__arch64__)