+2019-02-21 Mark Wielaard <mark@klomp.org>
+
+ * common.h (determine_kind): Only accept EV_CURRENT.
+ * elf32_fsize.c (fsize): Just check version is EV_CURRENT.
+ Use __libelf_type_size without version dimension.
+ * elf32_updatefile.c (updatemmap): Define fctp from __elf_xfctstom
+ without version dimension.
+ (updatefile): Likewise.
+ * elf32_updatenull.c (default_ehdr): Check e_version is EV_CURRENT.
+ (updatenull_wrlock): Check d_version is EV_CURRENT.
+ (elf32_xlatetof): Likewise. And get recsize without version
+ dimension from __elf_xfctstom.
+ (elf32_xlatetom): Likewise.
+ * elf_begin.c (elf_begin): Check __libelf_version is EV_CURRENT.
+ * elf_compress.c (__libelf_reset_rawdata): Set d_version to
+ EV_CURRENT.
+ * elf_getdata.c (shtype_map): Remove version dimension.
+ (__libelf_type_aligns): Likewise.
+ (__libelf_data_type): Use shtype_map without version dimension.
+ (convert_data): Remove unused version argument. Get fp from
+ __elf_xfctstom without version dimensions.
+ (__libelf_set_data_list_rdlock): Call convert_data without version.
+ * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Call __elfcfctstom
+ conversion function without version dimensions. Set d_version to
+ EV_CURRENT.
+ * elf_newdata.c (elf_newdata): Set d_version to EV_CURRENT.
+ * elf_version.c (__libelf_version_initialized): Removed.
+ (__libelf_version): Initialized to EV_NONE.
+ (elf_version): Always return EV_CURRENT for EV_NONE version.
+ Only accept (and return) EV_CURRENT as version.
+ * gelf_fsize.c (__libelf_type_sizes): Remove version dimension.
+ (gelf_fsize): Only accept EV_CURRENT as version.
+ Use __libelf_type_sizes without version dimension.
+ * gelf_xlate.c (__elf_xftstom): Remove version dimensions.
+ * libelfP.h (__elf_xfctstom): Defined without version dimensions.
+ (__elf_xfctstof): Likewise.
+ (__libelf_type_sizes): Define without version dimension.
+ (elf_typesize): Define using __libelf_type_sizes without version
+ dimension.
+ (__libelf_version_initialized): Remove definition.
+ (__libelf_version): Add definition.
+ (LIBELF_EV_IDX): Removed define.
+ (__libelf_type_aligns): Remove version dimension.
+ * nlist.c (nlist): Call elf_version unconditionally.
+
2019-02-19 Mark Wielaard <mark@klomp.org>
* elf_compress.c (do_deflate_cleanup): Remove ei_data argument,
if (eclass > ELFCLASSNONE && eclass < ELFCLASSNUM
&& data > ELFDATANONE && data < ELFDATANUM
- && version > EV_NONE && version < EV_NUM)
+ && version == EV_CURRENT)
return ELF_K_ELF;
}
{
/* We do not have differences between file and memory sizes. Better
not since otherwise `mmap' would not work. */
- if (unlikely (version == EV_NONE) || unlikely (version >= EV_NUM))
+ if (unlikely (version != EV_CURRENT))
{
__libelf_seterrno (ELF_E_UNKNOWN_VERSION);
return 0;
return 0;
}
-#if EV_NUM != 2
- return (count
- * __libelf_type_sizes[version - 1][ELFW(ELFCLASS,LIBELFBITS) - 1][type]);
-#else
- return (count
- * __libelf_type_sizes[0][ELFW(ELFCLASS,LIBELFBITS) - 1][type]);
-#endif
+ return (count * __libelf_type_sizes[ELFW(ELFCLASS,LIBELFBITS) - 1][type]);
}
#define local_strong_alias(n1, n2) strong_alias (n1, n2)
local_strong_alias (elfw2(LIBELFBITS, fsize), __elfw2(LIBELFBITS, msize))
if (unlikely (change_bo))
{
/* Today there is only one version of the ELF header. */
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR]
/* Do the real work. */
(*fctp) ((char *) elf->map_address + elf->start_offset, ehdr,
if (unlikely (change_bo))
{
/* Today there is only one version of the ELF header. */
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR]
/* Do the real work. */
(*fctp) (elf->map_address + elf->start_offset + ehdr->e_phoff,
+ ehdr->e_shoff);
char *const shdr_end = shdr_start + shnum * ehdr->e_shentsize;
-#if EV_NUM != 2
- xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
-#else
-# undef shdr_fctp
-# define shdr_fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]
-#endif
+#undef shdr_fctp
+#define shdr_fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]
#define shdr_dest ((ElfW2(LIBELFBITS,Shdr) *) shdr_start)
/* Get all sections into the array and sort them. */
&& dl->data.d.d_size != 0
&& dl->data.d.d_type != ELF_T_BYTE))
{
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][dl->data.d.d_version - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type]
size_t align;
align = __libelf_type_align (ELFW(ELFCLASS,LIBELFBITS),
if (unlikely (change_bo))
{
/* Today there is only one version of the ELF header. */
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR]
/* Write the converted ELF header in a temporary buffer. */
(*fctp) (&tmp_ehdr, ehdr, sizeof (ElfW2(LIBELFBITS,Ehdr)), 1);
if (unlikely (change_bo))
{
/* Today there is only one version of the ELF header. */
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR]
/* Allocate sufficient memory. */
tmp_phdr = (ElfW2(LIBELFBITS,Phdr) *)
return 1;
off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
-#if EV_NUM != 2
- xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
-#else
-# undef shdr_fctp
-# define shdr_fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]
-#endif
+#undef shdr_fctp
+#define shdr_fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]
ElfW2(LIBELFBITS,Shdr) *shdr_data;
ElfW2(LIBELFBITS,Shdr) *shdr_data_mem = NULL;
if (unlikely (change_bo))
{
-#if EV_NUM != 2
- xfct_t fctp;
- fctp = __elf_xfctstom[__libelf_version - 1][dl->data.d.d_version - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type];
-#else
-# undef fctp
-# define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type]
-#endif
+#undef fctp
+#define fctp __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type]
buf = tmpbuf;
if (dl->data.d.d_size > MAX_TMPBUF)
ehdr->e_version = EV_CURRENT;
elf->state.ELFW(elf,LIBELFBITS).ehdr_flags |= ELF_F_DIRTY;
}
- else if (unlikely (ehdr->e_version >= EV_NUM))
+ else if (unlikely (ehdr->e_version != EV_CURRENT))
{
__libelf_seterrno (ELF_E_UNKNOWN_VERSION);
return 1;
&& scn->rawdata.d.d_buf != NULL)
data = &scn->rawdata.d;
- if (unlikely (data->d_version == EV_NONE)
- || unlikely (data->d_version >= EV_NUM))
+ if (unlikely (data->d_version != EV_CURRENT))
{
__libelf_seterrno (ELF_E_UNKNOWN_VERSION);
return -1;
type. This means, whether there is an integer number of records.
Note that for this implementation the memory and file size of the
data types are identical. */
-#if EV_NUM != 2
- size_t recsize = __libelf_type_sizes[src->d_version - 1][ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
-#else
- size_t recsize = __libelf_type_sizes[0][ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
-#endif
+ size_t recsize = __libelf_type_sizes[ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
if (src->d_size % recsize != 0)
{
else
{
xfct_t fctp;
-
- /* Get a pointer to the transformation functions. The `#ifdef' is
- a small optimization since we don't anticipate another ELF
- version and so would waste "precious" code. */
-#if EV_NUM != 2
- fctp = __elf_xfctstom[dest->d_version - 1][src->d_version - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
-#else
- fctp = __elf_xfctstom[0][0][ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
-#endif
+ fctp = __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
/* Do the real work. */
(*fctp) (dest->d_buf, src->d_buf, src->d_size, 1);
type. This means, whether there is an integer number of records.
Note that for this implementation the memory and file size of the
data types are identical. */
-#if EV_NUM != 2
- size_t recsize = __libelf_type_sizes[src->d_version - 1][ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
-#else
- size_t recsize = __libelf_type_sizes[0][ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
-#endif
+ size_t recsize = __libelf_type_sizes[ELFW(ELFCLASS,LIBELFBITS) - 1][src->d_type];
/* We shouldn't require integer number of records when processing
else
{
xfct_t fctp;
-
- /* Get a pointer to the transformation functions. The `#ifdef' is
- a small optimization since we don't anticipate another ELF
- version and so would waste "precious" code. */
-#if EV_NUM != 2
- fctp = __elf_xfctstom[src->d_version - 1][dest->d_version - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
-#else
- fctp = __elf_xfctstom[0][0][ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
-#endif
+ fctp = __elf_xfctstom[ELFW(ELFCLASS, LIBELFBITS) - 1][src->d_type];
/* Do the real work. */
(*fctp) (dest->d_buf, src->d_buf, src->d_size, 0);
{
Elf *retval;
- if (unlikely (! __libelf_version_initialized))
+ if (unlikely (__libelf_version != EV_CURRENT))
{
/* Version wasn't set so far. */
__libelf_seterrno (ELF_E_NO_VERSION);
{
/* This is the new raw data, replace and possibly free old data. */
scn->rawdata.d.d_off = 0;
- scn->rawdata.d.d_version = __libelf_version;
+ scn->rawdata.d.d_version = EV_CURRENT;
scn->rawdata.d.d_buf = buf;
scn->rawdata.d.d_size = size;
scn->rawdata.d.d_align = align;
: 0))
/* Associate section types with libelf types. */
-static const Elf_Type shtype_map[EV_NUM - 1][TYPEIDX (SHT_HISUNW) + 1] =
+static const Elf_Type shtype_map[TYPEIDX (SHT_HISUNW) + 1] =
{
- [EV_CURRENT - 1] =
- {
[SHT_SYMTAB] = ELF_T_SYM,
[SHT_RELA] = ELF_T_RELA,
[SHT_HASH] = ELF_T_WORD,
[TYPEIDX (SHT_SUNW_move)] = ELF_T_MOVE,
[TYPEIDX (SHT_GNU_LIBLIST)] = ELF_T_LIB,
[TYPEIDX (SHT_GNU_HASH)] = ELF_T_GNUHASH,
- }
};
/* Associate libelf types with their internal alignment requirements. */
-const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
+const uint_fast8_t __libelf_type_aligns[ELFCLASSNUM - 1][ELF_T_NUM] =
{
# define TYPE_ALIGNS(Bits) \
{ \
[ELF_T_CHDR] = __alignof__ (ElfW2(Bits,Chdr)), \
[ELF_T_NHDR8] = 8 /* Special case for GNU Property note. */ \
}
- [EV_CURRENT - 1] =
- {
[ELFCLASS32 - 1] = TYPE_ALIGNS (32),
[ELFCLASS64 - 1] = TYPE_ALIGNS (64),
- }
# undef TYPE_ALIGNS
};
}
else
{
- Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (sh_type)];
+ Elf_Type t = shtype_map[TYPEIDX (sh_type)];
/* Special case for GNU Property notes. */
if (t == ELF_T_NHDR && align == 8)
t = ELF_T_NHDR8;
/* Convert the data in the current section. */
static void
-convert_data (Elf_Scn *scn, int version __attribute__ ((unused)), int eclass,
+convert_data (Elf_Scn *scn, int eclass,
int data, size_t size, Elf_Type type)
{
const size_t align = __libelf_type_align (eclass, type);
}
/* Get the conversion function. */
-#if EV_NUM != 2
- fp = __elf_xfctstom[version - 1][__libelf_version - 1][eclass - 1][type];
-#else
- fp = __elf_xfctstom[0][0][eclass - 1][type];
-#endif
+ fp = __elf_xfctstom[eclass - 1][type];
fp (scn->data_base, rawdata_source, size, 0);
}
else
{
- Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (type)];
+ Elf_Type t = shtype_map[TYPEIDX (type)];
if (t == ELF_T_NHDR && align == 8)
t = ELF_T_NHDR8;
if (t == ELF_T_VDEF || t == ELF_T_NHDR || t == ELF_T_NHDR8
|| (t == ELF_T_GNUHASH && elf->class == ELFCLASS64))
entsize = 1;
else
- entsize = __libelf_type_sizes[LIBELF_EV_IDX][elf->class - 1][t];
+ entsize = __libelf_type_sizes[elf->class - 1][t];
}
/* We assume it is an array of bytes if it is none of the structured
}
/* Convert according to the version and the type. */
- convert_data (scn, __libelf_version, elf->class,
+ convert_data (scn, elf->class,
(elf->class == ELFCLASS32
|| (offsetof (struct Elf, state.elf32.ehdr)
== offsetof (struct Elf, state.elf64.ehdr))
}
/* Call the conversion function. */
- (*__elf_xfctstom[LIBELF_EV_IDX][LIBELF_EV_IDX][elf->class - 1][type])
- (buffer, rawchunk, size, 0);
+ (*__elf_xfctstom[elf->class - 1][type])(buffer, rawchunk, size, 0);
}
/* Allocate the dummy container to point at this buffer. */
chunk->data.d.d_size = size;
chunk->data.d.d_type = type;
chunk->data.d.d_align = align;
- chunk->data.d.d_version = __libelf_version;
+ chunk->data.d.d_version = EV_CURRENT;
rwlock_unlock (elf->lock);
rwlock_wrlock (elf->lock);
}
/* Set the predefined values. */
- result->data.d.d_version = __libelf_version;
+ result->data.d.d_version = EV_CURRENT;
result->data.s = scn;
#include <libelfP.h>
-/* Is the version initialized? */
-int __libelf_version_initialized;
-
-/* Currently selected version. */
-unsigned int __libelf_version = EV_CURRENT;
-
+/* Currently selected version. Should be EV_CURRENT.
+ Will be EV_NONE if elf_version () has not been called yet. */
+unsigned int __libelf_version = EV_NONE;
unsigned int
elf_version (unsigned int version)
{
if (version == EV_NONE)
- return __libelf_version;
+ return EV_CURRENT;
- if (likely (version < EV_NUM))
+ if (likely (version == EV_CURRENT))
{
/* Phew, we know this version. */
- unsigned int last_version = __libelf_version;
-
- /* Store the new version. */
- __libelf_version = version;
/* Signal that the version is now initialized. */
- __libelf_version_initialized = 1;
+ __libelf_version = EV_CURRENT;
- /* And return the last version. */
- return last_version;
+ /* And return the last (or initial) version. */
+ return EV_CURRENT;
}
/* We cannot handle this version. */
/* These are the sizes for all the known types. */
-const size_t __libelf_type_sizes[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
+const size_t __libelf_type_sizes[ELFCLASSNUM - 1][ELF_T_NUM] =
{
- /* We have no entry for EV_NONE since we have to set an error. */
- [EV_CURRENT - 1] = {
[ELFCLASS32 - 1] = {
#define TYPE_SIZES(LIBELFBITS) \
[ELF_T_ADDR] = ELFW2(LIBELFBITS, FSZ_ADDR), \
[ELFCLASS64 - 1] = {
TYPE_SIZES (64)
}
- }
};
if (elf == NULL)
return 0;
- if (version == EV_NONE || version >= EV_NUM)
+ if (version != EV_CURRENT)
{
__libelf_seterrno (ELF_E_UNKNOWN_VERSION);
return 0;
return 0;
}
-#if EV_NUM != 2
- return count * __libelf_type_sizes[version - 1][elf->class - 1][type];
-#else
- return count * __libelf_type_sizes[0][elf->class - 1][type];
-#endif
+ return count * __libelf_type_sizes[elf->class - 1][type];
}
INTDEF(gelf_fsize)
/* Now the externally visible table with the function pointers. */
-const xfct_t __elf_xfctstom[EV_NUM - 1][EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
+const xfct_t __elf_xfctstom[ELFCLASSNUM - 1][ELF_T_NUM] =
{
- [EV_CURRENT - 1] = {
- [EV_CURRENT - 1] = {
[ELFCLASS32 - 1] = {
#define define_xfcts(Bits) \
[ELF_T_BYTE] = elf_cvt_Byte, \
define_xfcts (64),
[ELF_T_GNUHASH] = elf_cvt_gnuhash
}
- }
- }
};
/* For now we only handle the case where the memory representation is the
same as the file representation. Should this change we have to define
typedef void (*xfct_t) (void *, const void *, size_t, int);
/* The table with the function pointers. */
-extern const xfct_t __elf_xfctstom[EV_NUM - 1][EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
-extern const xfct_t __elf_xfctstof[EV_NUM - 1][EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
+extern const xfct_t __elf_xfctstom[ELFCLASSNUM - 1][ELF_T_NUM]
+ attribute_hidden;
+extern const xfct_t __elf_xfctstof[ELFCLASSNUM - 1][ELF_T_NUM]
+ attribute_hidden;
/* Array with sizes of the external types indexed by ELF version, binary
class, and type. */
-extern const size_t __libelf_type_sizes[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
+extern const size_t __libelf_type_sizes[ELFCLASSNUM - 1][ELF_T_NUM]
+ attribute_hidden;
/* We often have to access the size for a type in the current version. */
-#if EV_NUM != 2
# define elf_typesize(class,type,n) \
- elfw2(class,fsize) (type, n, __libelf_version)
-#else
-# define elf_typesize(class,type,n) \
- (__libelf_type_sizes[EV_CURRENT - 1][ELFW(ELFCLASS,class) - 1][type] * n)
-#endif
-
-/* Currently selected version of the ELF specification. */
-extern unsigned int __libelf_version attribute_hidden;
+ (__libelf_type_sizes[ELFW(ELFCLASS,class) - 1][type] * n)
/* The byte value used for filling gaps. */
extern int __libelf_fill_byte attribute_hidden;
-/* Nonzero if the version was set. */
-extern int __libelf_version_initialized attribute_hidden;
-
-/* Index for __libelf_type_sizes et al. */
-#if EV_NUM == 2
-# define LIBELF_EV_IDX 0
-#else
-# define LIBELF_EV_IDX (__libelf_version - 1)
-#endif
+/* EV_CURRENT if the version was set, EV_NONE otherwise. */
+extern unsigned int __libelf_version attribute_hidden;
-/* Array with alignment requirements of the internal types indexed by ELF
- version, binary class, and type. */
-extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
+/* Array with alignment requirements of the internal types indexed by
+ binary class, and type. */
+extern const uint_fast8_t __libelf_type_aligns[ELFCLASSNUM - 1][ELF_T_NUM]
+ attribute_hidden;
# define __libelf_type_align(class, type) \
- (__libelf_type_aligns[LIBELF_EV_IDX][class - 1][type] ?: 1)
+ (__libelf_type_aligns[class - 1][type] ?: 1)
/* Given an Elf handle and a section type returns the Elf_Data d_type.
Should not be called when SHF_COMPRESSED is set, the d_type should
/* For compatibility reasons (`nlist' existed before ELF and libelf)
we don't expect the caller to set the ELF version. Do this here
- if it hasn't happened yet. */
- if (__libelf_version_initialized == 0)
- INTUSE(elf_version) (EV_CURRENT);
+ as if it hasn't happened yet. */
+ INTUSE(elf_version) (EV_CURRENT);
/* Now get an ELF descriptor. */
elf = INTUSE(elf_begin) (fd, ELF_C_READ_MMAP, NULL);