diff --git a/src/format/elf.c b/src/format/elf.c index 21fc34d..b3e43f0 100644 --- a/src/format/elf.c +++ b/src/format/elf.c @@ -23,7 +23,11 @@ #include #include #include -#include +#ifdef __OpenBSD__ +# include +#else +# include +#endif #include "Asm.h" /* portability */ @@ -118,7 +122,9 @@ static int _elfstrtab_set(AsmFormatPlugin * format, ElfStrtab * strtab, /* variables */ static ElfArch elf_arch[] = { +#ifdef EM_X86_64 { "amd64", EM_X86_64, ELFCLASS64, ELFDATA2LSB, 0x4 }, +#endif { "arm", EM_ARM, ELFCLASS32, ELFDATA2LSB, 0x0 }, { "armeb", EM_ARM, ELFCLASS32, ELFDATA2MSB, 0x0 }, { "armel", EM_ARM, ELFCLASS32, ELFDATA2LSB, 0x0 }, @@ -357,8 +363,10 @@ static char const * _detect_64(AsmFormatPlugin * format, Elf64_Ehdr * ehdr) case EM_SPARC: case EM_SPARCV9: return "sparc64"; +#ifdef EM_X86_64 case EM_X86_64: return "amd64"; +#endif } format->decode = _elf_decode; error_set_code(1, "%s: %s 0x%x", "elf", "Unsupported ELF architecture",