Module Name:    src
Committed By:   thorpej
Date:           Sat Dec 19 07:31:04 UTC 2009

Modified Files:
        src/external/bsd/libelf/dist: elf_types.m4 gelf.h gelf_cap.c
            gelf_move.c gelf_syminfo.c libelf.h libelf_align.c
            libelf_convert.m4 libelf_data.c libelf_fsize.m4 libelf_msize.m4

Log Message:
Centralize dependency on __FreeBSD_version into libelf.h, and generalize
the conditional inclusion of API/ELF features so that it works with NetBSD
as well.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libelf/dist/elf_types.m4 \
    src/external/bsd/libelf/dist/gelf.h src/external/bsd/libelf/dist/libelf.h \
    src/external/bsd/libelf/dist/libelf_align.c \
    src/external/bsd/libelf/dist/libelf_data.c \
    src/external/bsd/libelf/dist/libelf_fsize.m4 \
    src/external/bsd/libelf/dist/libelf_msize.m4
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libelf/dist/gelf_cap.c \
    src/external/bsd/libelf/dist/gelf_move.c \
    src/external/bsd/libelf/dist/gelf_syminfo.c \
    src/external/bsd/libelf/dist/libelf_convert.m4

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/elf_types.m4
diff -u src/external/bsd/libelf/dist/elf_types.m4:1.1.1.1 src/external/bsd/libelf/dist/elf_types.m4:1.2
--- src/external/bsd/libelf/dist/elf_types.m4:1.1.1.1	Sat Dec 19 05:43:40 2009
+++ src/external/bsd/libelf/dist/elf_types.m4	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_types.m4,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $	*/
+/*	$NetBSD: elf_types.m4,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -31,41 +31,36 @@
 /*
  * ELF types, defined in the "enum Elf_Type" API.
  *
- * The members of the list form a 3-tuple: (name, C-type-suffix, OSversion).
+ * The members of the list form a 3-tuple: (name, C-type-suffix, condition).
  * + `name' is an Elf_Type symbol without the `ELF_T_' prefix.
  * + `C-type-suffix' is the suffix for Elf32_ and Elf64_ type names.
- * + `version' is the OS version the symbol first appeared in.
- *
- * OS revisions of note are:
- * 600102 - The earliest (6.0-STABLE) version supported by this code.
- * 700009 - Symbol versioning and ELF64 type changes.
- * 700025 - More ELF types and the introduction of libelf.
+ * + `condition' is the conditional check for this type.
  */
 
 define(`ELF_TYPE_LIST',
-	``ADDR,		Addr,	600102',
-	`BYTE,		Byte,	600102',
-	`CAP,		Cap,	700025',
-	`DYN,		Dyn,	600102',
-	`EHDR,		Ehdr,	600102',
-	`HALF,		Half,	600102',
-	`LWORD,		Lword,	700025',
-	`MOVE,		Move,	700025',
-	`MOVEP,		MoveP,	700025',
-	`NOTE,		Note,	600102',
-	`OFF,		Off,	600102',
-	`PHDR,		Phdr,	600102',
-	`REL,		Rel,	600102',
-	`RELA,		Rela,	600102',
-	`SHDR,		Shdr,	600102',
-	`SWORD,		Sword,	600102',
-	`SXWORD,	Sxword,	700009',
-	`SYMINFO,	Syminfo, 700025',
-	`SYM,		Sym,	600102',
-	`VDEF,		Verdef,	700009',
-	`VNEED,		Verneed, 700009',
-	`WORD,		Word,	600102',
-	`XWORD,		Xword,	700009',
+	``ADDR,		Addr,	1',
+	`BYTE,		Byte,	1',
+	`CAP,		Cap,	__LIBELF_HAVE_ELF_CAP',
+	`DYN,		Dyn,	1',
+	`EHDR,		Ehdr,	1',
+	`HALF,		Half,	1',
+	`LWORD,		Lword,	__LIBELF_HAVE_ELF_MOVE',
+	`MOVE,		Move,	__LIBELF_HAVE_ELF_MOVE',
+	`MOVEP,		MoveP,	__LIBELF_HAVE_ELF_MOVE',
+	`NOTE,		Note,	1',
+	`OFF,		Off,	1',
+	`PHDR,		Phdr,	1',
+	`REL,		Rel,	1',
+	`RELA,		Rela,	1',
+	`SHDR,		Shdr,	1',
+	`SWORD,		Sword,	1',
+	`SXWORD,	Sxword,	__LIBELF_HAVE_ELF_VERS',
+	`SYMINFO,	Syminfo, __LIBELF_HAVE_ELF_SYMINFO',
+	`SYM,		Sym,	1',
+	`VDEF,		Verdef,	__LIBELF_HAVE_ELF_VERS',
+	`VNEED,		Verneed, __LIBELF_HAVE_ELF_VERS',
+	`WORD,		Word,	1',
+	`XWORD,		Xword,	__LIBELF_HAVE_ELF_VERS',
 	`NUM,		_,	_'')
 
 /*
Index: src/external/bsd/libelf/dist/gelf.h
diff -u src/external/bsd/libelf/dist/gelf.h:1.1.1.1 src/external/bsd/libelf/dist/gelf.h:1.2
--- src/external/bsd/libelf/dist/gelf.h:1.1.1.1	Sat Dec 19 05:43:40 2009
+++ src/external/bsd/libelf/dist/gelf.h	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gelf.h,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $	*/
+/*	$NetBSD: gelf.h,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -34,7 +34,6 @@
 #include <sys/cdefs.h>
 
 #include <libelf.h>
-#include <osreldate.h>
 
 typedef Elf64_Addr	GElf_Addr;	/* Addresses */
 typedef Elf64_Half	GElf_Half;	/* Half words (16 bit) */
@@ -52,9 +51,13 @@
 typedef Elf64_Rel	GElf_Rel;	/* Relocation entries */
 typedef Elf64_Rela	GElf_Rela;	/* Relocation entries with addend */
 
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_CAP)
 typedef	Elf64_Cap	GElf_Cap;	/* SW/HW capabilities */
+#endif
+#if defined(__LIBELF_HAVE_ELF_MOVE)
 typedef Elf64_Move	GElf_Move;	/* Move entries */
+#endif
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
 typedef Elf64_Syminfo	GElf_Syminfo;	/* Symbol information */
 #endif
 
@@ -102,14 +105,21 @@
 Elf_Data 	*gelf_xlatetof(Elf *_elf, Elf_Data *_dst, const Elf_Data *_src, unsigned int _encode);
 Elf_Data 	*gelf_xlatetom(Elf *_elf, Elf_Data *_dst, const Elf_Data *_src, unsigned int _encode);
 
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_CAP)
 GElf_Cap	*gelf_getcap(Elf_Data *_data, int _index, GElf_Cap *_cap);
-GElf_Move	*gelf_getmove(Elf_Data *_src, int _index, GElf_Move *_dst);
-GElf_Syminfo	*gelf_getsyminfo(Elf_Data *_src, int _index, GElf_Syminfo *_dst);
 int		gelf_update_cap(Elf_Data *_dst, int _index, GElf_Cap *_src);
+#endif /* __LIBELF_HAVE_ELF_CAP */
+
+#if defined(__LIBELF_HAVE_ELF_MOVE)
+GElf_Move	*gelf_getmove(Elf_Data *_src, int _index, GElf_Move *_dst);
 int		gelf_update_move(Elf_Data *_dst, int _index, GElf_Move *_src);
+#endif /* __LIBELF_HAVE_ELF_MOVE */
+
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
+GElf_Syminfo	*gelf_getsyminfo(Elf_Data *_src, int _index, GElf_Syminfo *_dst);
 int		gelf_update_syminfo(Elf_Data *_dst, int _index, GElf_Syminfo *_src);
-#endif
+#endif /* __LIBELF_HAVE_ELF_SYMINFO */
+
 __END_DECLS
 
 #endif	/* _GELF_H_ */
Index: src/external/bsd/libelf/dist/libelf.h
diff -u src/external/bsd/libelf/dist/libelf.h:1.1.1.1 src/external/bsd/libelf/dist/libelf.h:1.2
--- src/external/bsd/libelf/dist/libelf.h:1.1.1.1	Sat Dec 19 05:43:40 2009
+++ src/external/bsd/libelf/dist/libelf.h	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf.h,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $	*/
+/*	$NetBSD: libelf.h,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -32,10 +32,32 @@
 #define	_LIBELF_H_
 
 #include <sys/types.h>
-#include <sys/elf32.h>
-#include <sys/elf64.h>
 #include <sys/queue.h>
 
+#if defined(__NetBSD__)
+# include <sys/exec_elf.h>
+# define __LIBELF_HAVE_ELF_CAP		1
+# define __LIBELF_HAVE_ELF_MOVE		1
+# define __LIBELF_HAVE_ELF_NOTE		1
+/* # define __LIBELF_HAVE_ELF_SYMINFO	1 */
+# define __LIBELF_HAVE_ELF_VERS		1
+#endif /* __NetBSD__ */
+
+#if defined(__FreeBSD__)
+# include <sys/elf32.h>
+# include <sys/elf64.h>
+# include <osreldate.h>
+# if __FreeBSD_version >= 700025
+#  define __LIBELF_HAVE_ELF_CAP		1
+#  define __LIBELF_HAVE_ELF_MOVE	1
+#  define __LIBELF_HAVE_ELF_NOTE	1
+#  define __LIBELF_HAVE_ELF_SYMINFO	1
+# endif /* __FreeBSD_version >= 700025 */
+# if __FreeBSD_version >= 700009
+#  define __LIBELF_HAVE_ELF_VERS	1
+# endif /* __FreeBSD_version >= 700009 */
+#endif /* __FreeBSD__ */
+
 /* Library private data structures */
 typedef struct _Elf Elf;
 typedef struct _Elf_Scn Elf_Scn;
Index: src/external/bsd/libelf/dist/libelf_align.c
diff -u src/external/bsd/libelf/dist/libelf_align.c:1.1.1.1 src/external/bsd/libelf/dist/libelf_align.c:1.2
--- src/external/bsd/libelf/dist/libelf_align.c:1.1.1.1	Sat Dec 19 05:43:40 2009
+++ src/external/bsd/libelf/dist/libelf_align.c	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_align.c,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $	*/
+/*	$NetBSD: libelf_align.c,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,15 +28,13 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/libelf_align.c,v 1.3.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: libelf_align.c,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $");
+__RCSID("$NetBSD: libelf_align.c,v 1.2 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <sys/types.h>
 
-#include <machine/elf.h>
 #include <machine/endian.h>
 
 #include <libelf.h>
-#include <osreldate.h>
 
 #include "_libelf.h"
 
@@ -65,18 +63,18 @@
 static struct align malign[ELF_T_NUM] = {
 	[ELF_T_ADDR]	= MALIGN(Addr),
 	[ELF_T_BYTE]	= { .a32 = 1, .a64 = 1 },
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_CAP)
 	[ELF_T_CAP]	= MALIGN(Cap),
 #endif
 	[ELF_T_DYN]	= MALIGN(Dyn),
 	[ELF_T_EHDR]	= MALIGN(Ehdr),
 	[ELF_T_HALF]	= MALIGN(Half),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_MOVE)
 	[ELF_T_LWORD]	= MALIGN(Lword),
 	[ELF_T_MOVE]	= MALIGN(Move),
 #endif
 	[ELF_T_MOVEP] 	= UNSUPPORTED(),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_NOTE)
 	[ELF_T_NOTE]	= MALIGN(Nhdr),
 #endif
 	[ELF_T_OFF]	= MALIGN(Off),
@@ -87,10 +85,10 @@
 	[ELF_T_SWORD]	= MALIGN(Sword),
 	[ELF_T_SXWORD]	= MALIGN64(Sxword),
 	[ELF_T_SYM]	= MALIGN(Sym),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
 	[ELF_T_SYMINFO]	= MALIGN(Syminfo),
 #endif
-#if	__FreeBSD_version >= 700009
+#if defined(__LIBELF_HAVE_ELF_VERS)
 	[ELF_T_VDEF]	= MALIGN(Verdef),
 	[ELF_T_VNEED]	= MALIGN(Verneed),
 #endif
@@ -113,18 +111,18 @@
 static struct align falign[ELF_T_NUM] = {
 	[ELF_T_ADDR]	= FALIGN(4,8),
 	[ELF_T_BYTE]	= FALIGN(1,1),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_CAP)
 	[ELF_T_CAP]	= FALIGN(4,8),
 #endif
 	[ELF_T_DYN]	= FALIGN(4,8),
 	[ELF_T_EHDR]	= FALIGN(4,8),
 	[ELF_T_HALF]	= FALIGN(2,2),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_MOVE)
 	[ELF_T_LWORD]	= FALIGN(8,8),
 	[ELF_T_MOVE]	= FALIGN(8,8),
 #endif
 	[ELF_T_MOVEP] 	= UNSUPPORTED(),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_NOTE)
 	[ELF_T_NOTE]	= FALIGN(1,1),
 #endif
 	[ELF_T_OFF]	= FALIGN(4,8),
@@ -135,10 +133,10 @@
 	[ELF_T_SWORD]	= FALIGN(4,4),
 	[ELF_T_SXWORD]	= FALIGN(0,8),
 	[ELF_T_SYM]	= FALIGN(4,8),
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
 	[ELF_T_SYMINFO]	= FALIGN(2,2),
 #endif
-#if	__FreeBSD_version >= 700009
+#if defined(__LIBELF_HAVE_ELF_VERS)
 	[ELF_T_VDEF]	= FALIGN(4,4),
 	[ELF_T_VNEED]	= FALIGN(4,4),
 #endif
Index: src/external/bsd/libelf/dist/libelf_data.c
diff -u src/external/bsd/libelf/dist/libelf_data.c:1.1.1.1 src/external/bsd/libelf/dist/libelf_data.c:1.2
--- src/external/bsd/libelf/dist/libelf_data.c:1.1.1.1	Sat Dec 19 05:43:41 2009
+++ src/external/bsd/libelf/dist/libelf_data.c	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_data.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $	*/
+/*	$NetBSD: libelf_data.c,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,10 +28,9 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/libelf_data.c,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: libelf_data.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
+__RCSID("$NetBSD: libelf_data.c,v 1.2 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <libelf.h>
-#include <osreldate.h>
 
 #include "_libelf.h"
 
@@ -69,18 +68,22 @@
 		return (ELF_T_SYM);
 	case SHT_SYMTAB_SHNDX:
 		return (ELF_T_WORD);
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_VERS)
 	case SHT_GNU_verdef:	/* == SHT_SUNW_verdef */
 		return (ELF_T_VDEF);
 	case SHT_GNU_verneed:	/* == SHT_SUNW_verneed */
 		return (ELF_T_VNEED);
 	case SHT_GNU_versym:	/* == SHT_SUNW_versym */
 		return (ELF_T_HALF);
+#endif /* __LIBELF_HAVE_ELF_VERS */
+#if defined(__LIBELF_HAVE_ELF_MOVE)
 	case SHT_SUNW_move:
 		return (ELF_T_MOVE);
+#endif /* __LIBELF_HAVE_ELF_MOVE */
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
 	case SHT_SUNW_syminfo:
 		return (ELF_T_SYMINFO);
-#endif
+#endif /* __LIBELF_HAVE_ELF_SYMINFO */
 	case SHT_AMD64_UNWIND:	/* == SHT_IA_64_UNWIND */
 		return (ELF_T_BYTE);
 	default:
Index: src/external/bsd/libelf/dist/libelf_fsize.m4
diff -u src/external/bsd/libelf/dist/libelf_fsize.m4:1.1.1.1 src/external/bsd/libelf/dist/libelf_fsize.m4:1.2
--- src/external/bsd/libelf/dist/libelf_fsize.m4:1.1.1.1	Sat Dec 19 05:43:41 2009
+++ src/external/bsd/libelf/dist/libelf_fsize.m4	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_fsize.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $	*/
+/*	$NetBSD: libelf_fsize.m4,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -117,7 +117,7 @@
 DEFINE_ELF_FSIZE(`IDENT',`')	# `IDENT' is a pseudo type
 
 define(`FSIZE',
-  `#if	__FreeBSD_version >= $3
+  `#if	$3
     [ELF_T_$1] = { .fsz32 = $1_SIZE32, .fsz64 = $1_SIZE64 },
 #endif')
 define(`FSIZES',
Index: src/external/bsd/libelf/dist/libelf_msize.m4
diff -u src/external/bsd/libelf/dist/libelf_msize.m4:1.1.1.1 src/external/bsd/libelf/dist/libelf_msize.m4:1.2
--- src/external/bsd/libelf/dist/libelf_msize.m4:1.1.1.1	Sat Dec 19 05:43:41 2009
+++ src/external/bsd/libelf/dist/libelf_msize.m4	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_msize.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $	*/
+/*	$NetBSD: libelf_msize.m4,v 1.2 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/libelf_msize.m4,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: libelf_msize.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
+__RCSID("$NetBSD: libelf_msize.m4,v 1.2 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/elf32.h>
@@ -77,7 +77,7 @@
 DEFINE_ELF_MSIZES(ELF_TYPE_LIST)
 
 define(`MSIZE',
-  `#if	__FreeBSD_version >= $3
+  `#if	$3
     [ELF_T_$1] = { .msz32 = $1_SIZE32, .msz64 = $1_SIZE64 },
 #endif')
 define(`MSIZES',

Index: src/external/bsd/libelf/dist/gelf_cap.c
diff -u src/external/bsd/libelf/dist/gelf_cap.c:1.2 src/external/bsd/libelf/dist/gelf_cap.c:1.3
--- src/external/bsd/libelf/dist/gelf_cap.c:1.2	Sat Dec 19 06:39:29 2009
+++ src/external/bsd/libelf/dist/gelf_cap.c	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gelf_cap.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $	*/
+/*	$NetBSD: gelf_cap.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,16 +28,15 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/gelf_cap.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: gelf_cap.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $");
+__RCSID("$NetBSD: gelf_cap.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <assert.h>
 #include <limits.h>
 #include <gelf.h>
-#include <osreldate.h>
 
 #include "_libelf.h"
 
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_CAP)
 
 GElf_Cap *
 gelf_getcap(Elf_Data *d, int ndx, GElf_Cap *dst)
@@ -149,4 +148,4 @@
 	return (1);
 }
 
-#endif	/* __FreeBSD_version >= 700025 */
+#endif /* __LIBELF_HAVE_ELF_CAP */
Index: src/external/bsd/libelf/dist/gelf_move.c
diff -u src/external/bsd/libelf/dist/gelf_move.c:1.2 src/external/bsd/libelf/dist/gelf_move.c:1.3
--- src/external/bsd/libelf/dist/gelf_move.c:1.2	Sat Dec 19 06:39:29 2009
+++ src/external/bsd/libelf/dist/gelf_move.c	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gelf_move.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $	*/
+/*	$NetBSD: gelf_move.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,16 +28,15 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/gelf_move.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: gelf_move.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $");
+__RCSID("$NetBSD: gelf_move.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <assert.h>
 #include <limits.h>
 #include <gelf.h>
-#include <osreldate.h>
 
 #include "_libelf.h"
 
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_MOVE)
 
 GElf_Move *
 gelf_getmove(Elf_Data *d, int ndx, GElf_Move *dst)
@@ -155,4 +154,4 @@
 	return (1);
 }
 
-#endif	/* __FreeBSD_version >= 700025 */
+#endif /* __LIBELF_HAVE_ELF_MOVE */
Index: src/external/bsd/libelf/dist/gelf_syminfo.c
diff -u src/external/bsd/libelf/dist/gelf_syminfo.c:1.2 src/external/bsd/libelf/dist/gelf_syminfo.c:1.3
--- src/external/bsd/libelf/dist/gelf_syminfo.c:1.2	Sat Dec 19 06:39:29 2009
+++ src/external/bsd/libelf/dist/gelf_syminfo.c	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gelf_syminfo.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $	*/
+/*	$NetBSD: gelf_syminfo.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Joseph Koshy
@@ -28,16 +28,15 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/gelf_syminfo.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: gelf_syminfo.c,v 1.2 2009/12/19 06:39:29 thorpej Exp $");
+__RCSID("$NetBSD: gelf_syminfo.c,v 1.3 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <assert.h>
 #include <limits.h>
 #include <gelf.h>
-#include <osreldate.h>
 
 #include "_libelf.h"
 
-#if	__FreeBSD_version >= 700025
+#if defined(__LIBELF_HAVE_ELF_SYMINFO)
 
 GElf_Syminfo *
 gelf_getsyminfo(Elf_Data *d, int ndx, GElf_Syminfo *dst)
@@ -150,4 +149,4 @@
 	return (1);
 }
 
-#endif	/* __FreeBSD_version >= 700025 */
+#endif /* __LIBELF_HAVE_ELF_SYMINFO */
Index: src/external/bsd/libelf/dist/libelf_convert.m4
diff -u src/external/bsd/libelf/dist/libelf_convert.m4:1.2 src/external/bsd/libelf/dist/libelf_convert.m4:1.3
--- src/external/bsd/libelf/dist/libelf_convert.m4:1.2	Sat Dec 19 05:55:37 2009
+++ src/external/bsd/libelf/dist/libelf_convert.m4	Sat Dec 19 07:31:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libelf_convert.m4,v 1.2 2009/12/19 05:55:37 thorpej Exp $	*/
+/*	$NetBSD: libelf_convert.m4,v 1.3 2009/12/19 07:31:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006,2007 Joseph Koshy
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libelf/libelf_convert.m4,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
-__RCSID("$NetBSD: libelf_convert.m4,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
+__RCSID("$NetBSD: libelf_convert.m4,v 1.3 2009/12/19 07:31:04 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/elf32.h>
@@ -450,7 +450,7 @@
  */
 
 define(`MAKE_TYPE_CONVERTER',
-  `#if	__FreeBSD_version >= $3 /* $1 */
+  `#if	$3 /* $1 */
 ifdef(`BASE'_$1,
     `ifdef(`IGNORE_'$1,`',
       `MAKEPRIM_TO_F($1,$2,`',64)
@@ -615,7 +615,7 @@
 
 define(`CONVERTER_NAME',
   `ifdef(`IGNORE_'$1,`',
-    `#if	__FreeBSD_version >= $3
+    `#if	$3
     [ELF_T_$1] = {
         CONV($1,32,tof), CONV($1,32,tom),
         CONV($1,64,tof), CONV($1,64,tom) },

Reply via email to