summaryrefslogtreecommitdiff
path: root/libelf/libelfP.h
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/libelfP.h')
-rw-r--r--libelf/libelfP.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 8ff8478c..50f92174 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -38,6 +38,7 @@
#include <gelf.h>
#include <errno.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -141,6 +142,10 @@ enum
ELF_E_INVALID_SECTION_TYPE,
ELF_E_INVALID_SECTION_FLAGS,
ELF_E_NOT_COMPRESSED,
+ ELF_E_ALREADY_COMPRESSED,
+ ELF_E_UNKNOWN_COMPRESSION_TYPE,
+ ELF_E_COMPRESS_ERROR,
+ ELF_E_DECOMPRESS_ERROR,
/* Keep this as the last entry. */
ELF_E_NUM
};
@@ -233,6 +238,8 @@ struct Elf_Scn
char *rawdata_base; /* The unmodified data of the section. */
char *data_base; /* The converted data of the section. */
+ char *zdata_base; /* The uncompressed data of the section. */
+
struct Elf_ScnList *list; /* Pointer to the section list element the
data is in. */
};
@@ -441,6 +448,11 @@ extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_
# define __libelf_type_align(class, type) 1
#endif
+/* 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
+ be ELF_T_BYTE. */
+extern Elf_Type __libelf_data_type (Elf *elf, int sh_type) internal_function;
+
/* The libelf API does not have such a function but it is still useful.
Get the memory size for the given type.
@@ -581,6 +593,18 @@ extern GElf_Sym *__gelf_getsym_internal (Elf_Data *__data, int __ndx,
extern uint32_t __libelf_crc32 (uint32_t crc, unsigned char *buf, size_t len)
attribute_hidden;
+extern void * __libelf_compress (Elf_Scn *scn, size_t hsize, int ei_data,
+ size_t *orig_size, size_t *orig_addralign,
+ size_t *size, bool force)
+ internal_function;
+
+extern void * __libelf_decompress (void *buf_in, size_t size_in,
+ size_t size_out) internal_function;
+
+extern void __libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size,
+ size_t align, Elf_Type type)
+ internal_function;
+
/* We often have to update a flag iff a value changed. Make this
convenient. */