summaryrefslogtreecommitdiff
path: root/src/format/elf/elf.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-03-14 22:18:27 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-14 22:18:27 (GMT)
commitfab9d7cd46922abea7d94f36dcd4630cdf3f4719 (patch)
treead41bb921db17631104a069e4df64fb4fc5ccfc1 /src/format/elf/elf.c
parent8d8e5c02096f59a7227308a591fc5050ea5d92ff (diff)
Improved the basic support of Dwarf information.
Diffstat (limited to 'src/format/elf/elf.c')
-rw-r--r--src/format/elf/elf.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index 4bc8bbf..0c7760c 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -62,6 +62,9 @@ static void g_elf_format_dispose(GElfFormat *);
/* Procède à la libération totale de la mémoire. */
static void g_elf_format_finalize(GElfFormat *);
+/* Informe quant au boutisme utilisé. */
+static SourceEndian g_elf_format_get_endianness(const GElfFormat *);
+
/* Indique le type d'architecture visée par le format. */
static const char *g_elf_format_get_target_machine(const GElfFormat *);
@@ -142,6 +145,7 @@ G_DEFINE_TYPE(GElfFormat, g_elf_format, G_TYPE_EXE_FORMAT);
static void g_elf_format_class_init(GElfFormatClass *klass)
{
GObjectClass *object; /* Autre version de la classe */
+ GBinFormatClass *fmt; /* Version en format basique */
GExeFormatClass *exe; /* Version en exécutable */
object = G_OBJECT_CLASS(klass);
@@ -149,6 +153,10 @@ static void g_elf_format_class_init(GElfFormatClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_elf_format_dispose;
object->finalize = (GObjectFinalizeFunc)g_elf_format_finalize;
+ fmt = G_BIN_FORMAT_CLASS(klass);
+
+ fmt->get_endian = (format_get_endian_fc)g_elf_format_get_endianness;
+
exe = G_EXE_FORMAT_CLASS(klass);
exe->get_machine = (get_target_machine_fc)g_elf_format_get_target_machine;
@@ -311,6 +319,25 @@ GBinFormat *g_elf_format_new(GBinContent *content, GExeFormat *parent)
* *
* Paramètres : format = informations chargées à consulter. *
* *
+* Description : Informe quant au boutisme utilisé. *
+* *
+* Retour : Indicateur de boutisme. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static SourceEndian g_elf_format_get_endianness(const GElfFormat *format)
+{
+ return format->endian;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = informations chargées à consulter. *
+* *
* Description : Indique le type d'architecture visée par le format. *
* *
* Retour : Identifiant de l'architecture ciblée par le format. *
@@ -703,22 +730,3 @@ const elf_header *g_elf_format_get_header(const GElfFormat *format)
return &format->header;
}
-
-
-/******************************************************************************
-* *
-* Paramètres : format = informations chargées à consulter. *
-* *
-* Description : Informe quant au boutisme utilisé. *
-* *
-* Retour : Indicateur de boutisme. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-SourceEndian g_elf_format_get_endianness(const GElfFormat *format)
-{
- return format->endian;
-
-}