summaryrefslogtreecommitdiff
path: root/plugins/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-04-22 20:01:37 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-04-22 20:01:37 (GMT)
commit1becb2053fdbb0f04935e8b90104f1f9907988ea (patch)
treee7f448fbe12eaa1907b7388f0c1c0c3d46023ce3 /plugins/elf
parent5235429714d9cc8425e6178eb7199e7ab55ff3c0 (diff)
Used the provided work group while loading ELF formats.
Diffstat (limited to 'plugins/elf')
-rw-r--r--plugins/elf/format.c9
-rw-r--r--plugins/elf/symbols.c27
-rw-r--r--plugins/elf/symbols.h4
3 files changed, 19 insertions, 21 deletions
diff --git a/plugins/elf/format.c b/plugins/elf/format.c
index 0fb2d1e..86682a2 100644
--- a/plugins/elf/format.c
+++ b/plugins/elf/format.c
@@ -70,7 +70,7 @@ static bool g_elf_format_analyze(GElfFormat *, wgroup_id_t, GtkStatusStack *);
static SourceEndian g_elf_format_get_endianness(const GElfFormat *);
/* Réalise un traitement post-désassemblage. */
-static void g_elf_format_complete_analysis(GElfFormat *, GtkStatusStack *);
+static void g_elf_format_complete_analysis(GElfFormat *, wgroup_id_t, GtkStatusStack *);
/* Indique le type d'architecture visée par le format. */
static const char *g_elf_format_get_target_machine(const GElfFormat *);
@@ -377,7 +377,7 @@ static bool g_elf_format_analyze(GElfFormat *format, wgroup_id_t gid, GtkStatusS
preload_binary_format(PGA_FORMAT_PRELOAD, base, base->info, status);
- if (!load_elf_symbols(format, status))
+ if (!load_elf_symbols(format, gid, status))
goto gefa_error;
if (!find_all_elf_strings(format))
@@ -417,6 +417,7 @@ static SourceEndian g_elf_format_get_endianness(const GElfFormat *format)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à manipuler. *
+* gid = groupe de travail dédié. *
* status = barre de statut à tenir informée. *
* *
* Description : Réalise un traitement post-désassemblage. *
@@ -427,9 +428,9 @@ static SourceEndian g_elf_format_get_endianness(const GElfFormat *format)
* *
******************************************************************************/
-static void g_elf_format_complete_analysis(GElfFormat *format, GtkStatusStack *status)
+static void g_elf_format_complete_analysis(GElfFormat *format, wgroup_id_t gid, GtkStatusStack *status)
{
- refresh_elf_relocations(format, status);
+ refresh_elf_relocations(format, gid, status);
}
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c
index 01b7a17..1cc0280 100644
--- a/plugins/elf/symbols.c
+++ b/plugins/elf/symbols.c
@@ -97,13 +97,13 @@ static bool load_elf_global_symbols(GElfFormat *, wgroup_id_t, GtkStatusStack *)
static bool do_elf_relocation_loading(GElfLoading *, GElfFormat *, phys_t *);
/* Charge en mémoire toutes les relocalisations présentes. */
-static bool load_elf_relocations(GElfFormat *, const elf_phdr *, elf_rel **, size_t *, GtkStatusStack *);
+static bool load_elf_relocations(GElfFormat *, const elf_phdr *, elf_rel **, size_t *, wgroup_id_t, GtkStatusStack *);
/* Assure l'intégration d'un symbole issu des relocalisations. */
static bool do_elf_relocation_renaming(GElfLoading *, GElfFormat *, GBinSymbol *);
/* Applique les étiquettes issues des relocalisations. */
-static bool apply_elf_relocations(GElfFormat *, elf_rel *, size_t, sym_iter_t *, GtkStatusStack *);
+static bool apply_elf_relocations(GElfFormat *, elf_rel *, size_t, sym_iter_t *, wgroup_id_t, GtkStatusStack *);
@@ -115,6 +115,7 @@ static bool apply_elf_relocations(GElfFormat *, elf_rel *, size_t, sym_iter_t *,
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* gid = groupe de travail impliqué. *
status = barre de statut à tenir informée. *
* *
* Description : Charge en mémoire la liste humaine des symboles. *
@@ -125,15 +126,12 @@ static bool apply_elf_relocations(GElfFormat *, elf_rel *, size_t, sym_iter_t *,
* *
******************************************************************************/
-bool load_elf_symbols(GElfFormat *format, GtkStatusStack *status)
+bool load_elf_symbols(GElfFormat *format, wgroup_id_t gid, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
- wgroup_id_t gid; /* Identifiant pour les tâches */
result = true;
- gid = g_work_queue_define_work_group(get_work_queue());
-
/* Symboles internes */
result &= load_elf_local_symbols(format, gid, status);
@@ -921,6 +919,7 @@ static bool do_elf_relocation_loading(GElfLoading *loading, GElfFormat *format,
* dynamic = en-tête de programme de type DYNAMIC. *
* relocs = liste des relocalisations triées à charger. [OUT] *
* count = taille de cette liste. [OUT] *
+* gid = groupe de travail dédié. *
* status = barre de statut à tenir informée. *
* *
* Description : Charge en mémoire toutes les relocalisations présentes. *
@@ -931,7 +930,7 @@ static bool do_elf_relocation_loading(GElfLoading *loading, GElfFormat *format,
* *
******************************************************************************/
-static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, elf_rel **relocs, size_t *count, GtkStatusStack *status)
+static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, elf_rel **relocs, size_t *count, wgroup_id_t gid, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
GExeFormat *exec; /* Autre vision du format */
@@ -945,7 +944,6 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
bool ret; /* Bilan d'un appel */
activity_id_t msg; /* Message de progression */
GWorkQueue *queue; /* Gestionnaire de différés */
- wgroup_id_t gid; /* Identifiant pour les tâches */
guint runs_count; /* Qté d'exécutions parallèles */
phys_t run_size; /* Volume réparti par exécution*/
GElfLoading **loadings; /* Tâches de chargement */
@@ -1012,7 +1010,6 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
msg = gtk_status_stack_add_activity(status, _("Loading relocations..."), length);
queue = get_work_queue();
- gid = g_work_queue_define_work_group(queue);
runs_count = g_get_num_processors();
@@ -1080,6 +1077,7 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
/******************************************************************************
* *
* Paramètres : format = informations chargées à consulter. *
+* gid = groupe de travail dédié. *
* status = barre de statut à tenir informée. *
* *
* Description : Actualise la désignation des fonctions externes à reloger. *
@@ -1090,7 +1088,7 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
* *
******************************************************************************/
-bool refresh_elf_relocations(GElfFormat *format, GtkStatusStack *status)
+bool refresh_elf_relocations(GElfFormat *format, wgroup_id_t gid, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
elf_phdr dynamic; /* En-tête de programme DYNAMIC*/
@@ -1110,7 +1108,7 @@ bool refresh_elf_relocations(GElfFormat *format, GtkStatusStack *status)
/* Chargement des relocalisations */
- if (!load_elf_relocations(format, &dynamic, &relocs, &rel_count, status))
+ if (!load_elf_relocations(format, &dynamic, &relocs, &rel_count, gid, status))
goto rer_quick_exit;
/* Localisation du code de la PLT */
@@ -1142,7 +1140,7 @@ bool refresh_elf_relocations(GElfFormat *format, GtkStatusStack *status)
if (result)
{
- result = apply_elf_relocations(format, relocs, rel_count, iter, status);
+ result = apply_elf_relocations(format, relocs, rel_count, iter, gid, status);
delete_symbol_iterator(iter);
@@ -1250,6 +1248,7 @@ static bool do_elf_relocation_renaming(GElfLoading *loading, GElfFormat *format,
* relocs = table des relocalisations chargées. *
* rel_count = nombre de ces éléments à interpréter. *
* iter = itérateur sur les symboles à parcourir. *
+* gid = groupe de travail dédié. *
* status = barre de statut à tenir informée. *
* *
* Description : Applique les étiquettes issues des relocalisations. *
@@ -1260,7 +1259,7 @@ static bool do_elf_relocation_renaming(GElfLoading *loading, GElfFormat *format,
* *
******************************************************************************/
-static bool apply_elf_relocations(GElfFormat *format, elf_rel *relocs, size_t rel_count, sym_iter_t *iter, GtkStatusStack *status)
+static bool apply_elf_relocations(GElfFormat *format, elf_rel *relocs, size_t rel_count, sym_iter_t *iter, wgroup_id_t gid, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
GExeFormat *exec; /* Autre vision du format */
@@ -1271,7 +1270,6 @@ static bool apply_elf_relocations(GElfFormat *format, elf_rel *relocs, size_t re
uint32_t sym_count; /* Nombre de symboles présents */
activity_id_t msg; /* Message de progression */
GWorkQueue *queue; /* Gestionnaire de différés */
- wgroup_id_t gid; /* Identifiant pour les tâches */
GElfLoading *loading; /* Tâche de chargement */
exec = G_EXE_FORMAT(format);
@@ -1302,7 +1300,6 @@ static bool apply_elf_relocations(GElfFormat *format, elf_rel *relocs, size_t re
msg = gtk_status_stack_add_activity(status, _("Applying relocations..."), rel_count);
queue = get_work_queue();
- gid = g_work_queue_define_work_group(queue);
loading = g_elf_loading_new_for_applying(format, iter, str_start, relocs, rel_count,
sym_start, sym_count, msg, do_elf_relocation_renaming);
diff --git a/plugins/elf/symbols.h b/plugins/elf/symbols.h
index 3bbc3ee..f51e504 100644
--- a/plugins/elf/symbols.h
+++ b/plugins/elf/symbols.h
@@ -38,7 +38,7 @@
/* Charge en mémoire la liste humaine des symboles. */
-bool load_elf_symbols(GElfFormat *, GtkStatusStack *);
+bool load_elf_symbols(GElfFormat *, wgroup_id_t , GtkStatusStack *);
@@ -46,7 +46,7 @@ bool load_elf_symbols(GElfFormat *, GtkStatusStack *);
/* Actualise la désignation des fonctions externes à reloger. */
-bool refresh_elf_relocations(GElfFormat *, GtkStatusStack *);
+bool refresh_elf_relocations(GElfFormat *, wgroup_id_t , GtkStatusStack *);