diff options
Diffstat (limited to 'plugins/elf/loading.h')
-rw-r--r-- | plugins/elf/loading.h | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/plugins/elf/loading.h b/plugins/elf/loading.h index 03ac184..79ea67f 100644 --- a/plugins/elf/loading.h +++ b/plugins/elf/loading.h @@ -25,6 +25,7 @@ #define _PLUGINS_ELF_LOADING_H +#include <format/symiter.h> #include <gtkext/gtkstatusstack.h> @@ -32,12 +33,12 @@ -#define G_TYPE_ELF_LOADING g_elf_loading_get_type() -#define G_ELF_LOADING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_elf_loading_get_type(), GElfLoading)) -#define G_IS_ELF_LOADING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_elf_loading_get_type())) -#define G_ELF_LOADING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ELF_LOADING, GElfLoadingClass)) -#define G_IS_ELF_LOADING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ELF_LOADING)) -#define G_ELF_LOADING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ELF_LOADING, GElfLoadingClass)) +#define G_TYPE_ELF_LOADING g_elf_loading_get_type() +#define G_ELF_LOADING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_ELF_LOADING, GElfLoading)) +#define G_IS_ELF_LOADING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_ELF_LOADING)) +#define G_ELF_LOADING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ELF_LOADING, GElfLoadingClass)) +#define G_IS_ELF_LOADING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ELF_LOADING)) +#define G_ELF_LOADING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ELF_LOADING, GElfLoadingClass)) /* Fraction de loading à limiter (instance) */ @@ -50,15 +51,36 @@ typedef struct _GElfLoadingClass GElfLoadingClass; /* Assure un chargement pour ELF en différé. */ typedef bool (* elf_loading_cb) (GElfLoading *, GElfFormat *, phys_t *); +/* Assure l'intégration d'un symbole issu des relocalisations. */ +typedef bool (* elf_applying_cb) (GElfLoading *, GElfFormat *, GBinSymbol *); + /* Indique le type défini pour les tâches de chargements pour format ELF. */ GType g_elf_loading_get_type(void); /* Crée une tâche de chargement pour ELF différée. */ -GElfLoading *g_elf_loading_new(GElfFormat *, const elf_shdr *, bool, phys_t, phys_t, phys_t, activity_id_t, elf_loading_cb); +GElfLoading *g_elf_loading_new_for_symbols(GElfFormat *, phys_t, phys_t, phys_t, phys_t, activity_id_t, elf_loading_cb); + +/* Crée une tâche de chargement pour ELF différée. */ +GElfLoading *g_elf_loading_new_for_relocations(GElfFormat *, phys_t, phys_t, elf_rel *, activity_id_t, elf_loading_cb); + +/* Crée une tâche de chargement pour ELF différée. */ +GElfLoading *g_elf_loading_new_for_applying(GElfFormat *, sym_iter_t *, phys_t, elf_rel *, size_t, phys_t, uint32_t, activity_id_t, elf_applying_cb); + +/* Fournit le bilan des traitements différés. */ +bool g_elf_loading_get_status(const GElfLoading *); + +/* Construit la désignation adaptée à un symbole. */ +const char *g_elf_loading_build_name(const GElfLoading *, uint32_t, virt_t, const char *, char *, vmpa2t *); + +/* Intègre dans la liste adaptée une relocalisation chargée. */ +void g_elf_loading_store_relocation(const GElfLoading *, const phys_t *, const elf_rel *); + +/* Recherche une relocalisation par son décalage. */ +bool g_elf_loading_search_for_relocation(const GElfLoading *, const uint64_t *, elf_rel **); -/* Fournit les infos utiles au chargement de symbols internes. */ -void g_elf_loading_get_internal_info(GElfLoading *, const elf_shdr **, bool *, const elf_shdr **, bool *, phys_t *); +/* Construit la désignation adaptée à un symbole importé. */ +char *g_elf_loading_build_plt_name(const GElfLoading *, uint64_t); |