Hello,
I couldn't compile libelf on amd64 machine running OpenBSD. LIBELF_ARCH
expands to EM_AMD64 on OpenBSD amd64 architecture which isn't listed in
elfdefinitions.h. The compilation error...
cc -pipe -g -I. -I/home/sunil/trunk/libelf -I/home/sunil/trunk/libelf/../common -g -c /home/sunil/trunk/libelf/elf.c -o elf.o
/home/sunil/trunk/libelf/elf.c:34: error: 'EM_AMD64' undeclared here (not in a function)
*** Error 1 in /home/sunil/trunk/libelf (<bsd.lib.mk>:37 'elf.o': @cc -pipe -g -I. -I/home/sunil/trunk/libelf -I/home/sunil/trunk/libelf/.....)
This patch defines EM_AMD64 as a synonym for EM_X86_64...
diff -up trunk/common/elfdefinitions.h elftoolchain/common/elfdefinitions.h
--- trunk/common/elfdefinitions.h Sat Nov 24 23:59:05 2012
+++ elftoolchain/common/elfdefinitions.h Sat Nov 24 23:59:40 2012
@@ -600,6 +600,8 @@ _ELF_DEFINE_EM(EM_ST100, 60, \
_ELF_DEFINE_EM(EM_TINYJ, 61, \
"Advanced Logic Corp. TinyJ embedded processor family") \
_ELF_DEFINE_EM(EM_X86_64, 62, "AMD x86-64 architecture") \
+_ELF_DEFINE_EM(EM_AMD64, EM_X86_64, \
+ "AMD x86-64 architecture") \
_ELF_DEFINE_EM(EM_PDSP, 63, "Sony DSP Processor") \
_ELF_DEFINE_EM(EM_PDP10, 64, \
"Digital Equipment Corp. PDP-10") \
|