summaryrefslogtreecommitdiff
path: root/src/format/symbol-int.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-04-09 20:23:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-04-09 20:23:33 (GMT)
commitee138199fe0d7bcc114cfb7001e968c4738a8ce5 (patch)
treef8fd344c7b9eb4227305c1af746fd5b4794fa179 /src/format/symbol-int.h
parent7ce6a7f670b83e1c51c87c0e421037c849df85c2 (diff)
Compressed the size of the symbol structures.
Diffstat (limited to 'src/format/symbol-int.h')
-rw-r--r--src/format/symbol-int.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/src/format/symbol-int.h b/src/format/symbol-int.h
index f1fb396..e2c3292 100644
--- a/src/format/symbol-int.h
+++ b/src/format/symbol-int.h
@@ -26,6 +26,7 @@
#include "symbol.h"
+#include "../glibext/objhole.h"
@@ -33,6 +34,19 @@
typedef char * (* get_symbol_label_fc) (const GBinSymbol *);
+/* Informations glissées dans la structure GObject de GArchInstruction */
+typedef union _sym_obj_extra
+{
+ struct
+ {
+ SymbolType stype; /* Type du symbole */
+ SymbolStatus status; /* Visibilité du symbole */
+
+ };
+
+ gint lock; /* Gestion d'accès aux fanions */
+
+} sym_obj_extra;
/* Symbole d'exécutable (instance) */
struct _GBinSymbol
@@ -40,13 +54,42 @@ struct _GBinSymbol
GObject parent; /* A laisser en premier */
mrange_t range; /* Couverture mémoire */
- SymbolType stype; /* Type du symbole */
- SymbolStatus status; /* Visibilité du symbole */
char *alt; /* Nom alternatif */
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+ /**
+ * L'inclusion des informations suivantes dépend de l'architecture.
+ *
+ * Si la structure GObject possède un trou, on remplit de préférence
+ * ce dernier.
+ */
+
+ sym_obj_extra extra; /* Externalisation embarquée */
+
+#endif
+
};
+/**
+ * Accès aux informations éventuellement déportées.
+ */
+
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+# define INIT_BIN_SYMBOL_EXTRA(sym) ins->extra.lock = 0
+
+# define GET_BIN_SYMBOL_EXTRA(sym) &ins->extra
+
+#else
+
+# define INIT_BIN_SYMBOL_EXTRA(sym) INIT_GOBJECT_EXTRA(G_OBJECT(sym))
+
+# define GET_BIN_SYMBOL_EXTRA(sym) GET_GOBJECT_EXTRA(G_OBJECT(sym), sym_obj_extra)
+
+#endif
+
/* Symbole d'exécutable (classe) */
struct _GBinSymbolClass
{