summaryrefslogtreecommitdiffstats
path: root/libelf/libelfP.h
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/libelfP.h')
-rw-r--r--libelf/libelfP.h65
1 files changed, 21 insertions, 44 deletions
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 9f3e8e9d..b55d5c48 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -296,7 +296,7 @@ struct Elf
int fildes;
/* Offset in the archive this file starts or zero. */
- off_t start_offset;
+ int64_t start_offset;
/* Size of the file in the archive or the entire file size, or ~0
for an (yet) unknown size. */
@@ -350,7 +350,7 @@ struct Elf
int ehdr_flags; /* Flags (dirty) for ELF header. */
int phdr_flags; /* Flags (dirty|malloc) for program header. */
int shdr_malloced; /* Nonzero if shdr array was allocated. */
- off_t sizestr_offset; /* Offset of the size string in the parent
+ int64_t sizestr_offset; /* Offset of the size string in the parent
if this is an archive member. */
Elf32_Ehdr ehdr_mem; /* Memory used for ELF header when not
mmaped. */
@@ -375,7 +375,7 @@ struct Elf
int ehdr_flags; /* Flags (dirty) for ELF header. */
int phdr_flags; /* Flags (dirty|malloc) for program header. */
int shdr_malloced; /* Nonzero if shdr array was allocated. */
- off_t sizestr_offset; /* Offset of the size string in the parent
+ int64_t sizestr_offset; /* Offset of the size string in the parent
if this is an archive member. */
Elf64_Ehdr ehdr_mem; /* Memory used for ELF header when not
mmaped. */
@@ -392,7 +392,7 @@ struct Elf
char *long_names; /* If no index is available but long names
are used this elements points to the data.*/
size_t long_names_len; /* Length of the long name table. */
- off_t offset; /* Offset in file we are currently at.
+ int64_t offset; /* Offset in file we are currently at.
elf_next() advances this to the next
member of the archive. */
Elf_Arhdr elf_ar_hdr; /* Structure returned by 'elf_getarhdr'. */
@@ -411,43 +411,30 @@ struct Elf
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;
/* 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
@@ -455,20 +442,10 @@ extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_
extern Elf_Type __libelf_data_type (Elf *elf, int sh_type, GElf_Xword align)
internal_function;
-/* The libelf API does not have such a function but it is still useful.
- Get the memory size for the given type.
-
- These functions cannot be marked internal since they are aliases
- of the export elfXX_fsize functions.*/
-extern size_t __elf32_msize (Elf_Type __type, size_t __count,
- unsigned int __version) __const_attribute__;
-extern size_t __elf64_msize (Elf_Type __type, size_t __count,
- unsigned int __version) __const_attribute__;
-
/* Create Elf descriptor from memory image. */
extern Elf *__libelf_read_mmaped_file (int fildes, void *map_address,
- off_t offset, size_t maxsize,
+ int64_t offset, size_t maxsize,
Elf_Cmd cmd, Elf *parent)
internal_function;
@@ -490,10 +467,10 @@ extern int __libelf_set_rawdata_wrlock (Elf_Scn *scn) internal_function;
/* Helper functions for elf_update. */
-extern off_t __elf32_updatenull_wrlock (Elf *elf, int *change_bop,
- size_t shnum) internal_function;
-extern off_t __elf64_updatenull_wrlock (Elf *elf, int *change_bop,
- size_t shnum) internal_function;
+extern int64_t __elf32_updatenull_wrlock (Elf *elf, int *change_bop,
+ size_t shnum) internal_function;
+extern int64_t __elf64_updatenull_wrlock (Elf *elf, int *change_bop,
+ size_t shnum) internal_function;
extern int __elf32_updatemmap (Elf *elf, int change_bo, size_t shnum)
internal_function;