diff options
Diffstat (limited to 'src/format/symbol-int.h')
-rw-r--r-- | src/format/symbol-int.h | 47 |
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 { |