Module Name: src
Committed By: thorpej
Date: Sat Dec 19 07:52:59 UTC 2009
Modified Files:
src/external/bsd/libelf/dist: libelf.c
Log Message:
ELF_ARCH, ELF_TARG_DATA, and ELF_TARG_CLASS are macros defined in a FreeBSD
header file. For NetBSD, map to equivalent defines.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libelf/dist/libelf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/libelf/dist/libelf.c
diff -u src/external/bsd/libelf/dist/libelf.c:1.2 src/external/bsd/libelf/dist/libelf.c:1.3
--- src/external/bsd/libelf/dist/libelf.c:1.2 Sat Dec 19 07:37:34 2009
+++ src/external/bsd/libelf/dist/libelf.c Sat Dec 19 07:52:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: libelf.c,v 1.2 2009/12/19 07:37:34 thorpej Exp $ */
+/* $NetBSD: libelf.c,v 1.3 2009/12/19 07:52:59 thorpej Exp $ */
/*-
* Copyright (c) 2006 Joseph Koshy
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libelf/libelf.c,v 1.1.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: libelf.c,v 1.2 2009/12/19 07:37:34 thorpej Exp $");
+__RCSID("$NetBSD: libelf.c,v 1.3 2009/12/19 07:52:59 thorpej Exp $");
#include <sys/param.h>
@@ -41,6 +41,18 @@
#include "_libelf.h"
+#if defined(__NetBSD__)
+# if ARCH_ELFSIZE == 64
+# define ELF_ARCH ELF64_MACHDEP_ID
+# define ELF_TARG_DATA ELF64_MACHDEP_ENDIANNESS
+# define ELF_TARG_CLASS ELFCLASS64
+# else
+# define ELF_ARCH ELF32_MACHDEP_ID
+# define ELF_TARG_DATA ELF32_MACHDEP_ENDIANNESS
+# define ELF_TARG_CLASS ELFCLASS32
+# endif /* ARCH_ELFSIZE */
+#endif /* __NetBSD__ */
+
struct _libelf_globals _libelf = {
.libelf_arch = ELF_ARCH,
.libelf_byteorder = ELF_TARG_DATA,