summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis/disass/links.c2
-rw-r--r--src/arch/Makefile.am1
-rw-r--r--src/arch/instructions/raw.c2
-rw-r--r--src/arch/operands/Makefile.am2
-rw-r--r--src/arch/operands/target-int.h58
-rw-r--r--src/arch/operands/target.c (renamed from src/arch/target.c)40
-rw-r--r--src/arch/operands/target.h (renamed from src/arch/target.h)12
-rw-r--r--src/arch/post.c2
-rw-r--r--src/arch/storage.c2
-rw-r--r--src/core/processors.c3
10 files changed, 80 insertions, 44 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c
index c4e7076..310da21 100644
--- a/src/analysis/disass/links.c
+++ b/src/analysis/disass/links.c
@@ -29,8 +29,8 @@
#include "../../arch/instruction.h"
#include "../../arch/instructions/raw.h"
-#include "../../arch/target.h"
#include "../../arch/operands/immediate.h"
+#include "../../arch/operands/target.h"
#include "../../arch/operands/targetable.h"
diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
index a8f9fb0..851570e 100644
--- a/src/arch/Makefile.am
+++ b/src/arch/Makefile.am
@@ -18,7 +18,6 @@ libarch_la_SOURCES = \
register-int.h \
register.h register.c \
storage.h storage.c \
- target.h target.c \
vmpa.h vmpa.c
libarch_la_LIBADD = \
diff --git a/src/arch/instructions/raw.c b/src/arch/instructions/raw.c
index 7c2535c..05eb886 100644
--- a/src/arch/instructions/raw.c
+++ b/src/arch/instructions/raw.c
@@ -33,8 +33,8 @@
#include "../instruction-int.h"
-#include "../target.h"
#include "../operands/immediate.h"
+#include "../operands/target.h"
diff --git a/src/arch/operands/Makefile.am b/src/arch/operands/Makefile.am
index 74f057d..25b4db2 100644
--- a/src/arch/operands/Makefile.am
+++ b/src/arch/operands/Makefile.am
@@ -11,6 +11,8 @@ libarchoperands_la_SOURCES = \
proxy.h proxy.c \
rename-int.h \
rename.h rename.c \
+ target-int.h \
+ target.h target.c \
targetable-int.h \
targetable.h targetable.c
diff --git a/src/arch/operands/target-int.h b/src/arch/operands/target-int.h
new file mode 100644
index 0000000..f3ed447
--- /dev/null
+++ b/src/arch/operands/target-int.h
@@ -0,0 +1,58 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * target-int.h - définitions internes propres aux opérandes ciblant un symbole
+ *
+ * Copyright (C) 2020 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ARCH_OPERANDS_TARGET_INT_H
+#define _ARCH_OPERANDS_TARGET_INT_H
+
+
+#include "target.h"
+#include "../operand-int.h"
+
+
+
+/* Définition d'un opérande ciblant idéalement un symbole connu (instance) */
+struct _GTargetOperand
+{
+ GArchOperand parent; /* Instance parente */
+
+ MemoryDataSize size; /* Taille de l'opérande */
+ vmpa2t addr; /* Adresse de l'élément visé */
+
+ bool strict; /* Résolution stricte */
+ /* Référence circulaire */
+ GBinSymbol *symbol; /* Eventuel symbole associé */
+ phys_t diff; /* Position dans le symbole */
+
+};
+
+
+/* Définition d'un opérande ciblant idéalement un symbole connu (classe) */
+struct _GTargetOperandClass
+{
+ GArchOperandClass parent; /* Classe parente */
+
+};
+
+
+
+#endif /* _ARCH_OPERANDS_TARGET_INT_H */
diff --git a/src/arch/target.c b/src/arch/operands/target.c
index 65fef30..d921200 100644
--- a/src/arch/target.c
+++ b/src/arch/operands/target.c
@@ -32,41 +32,17 @@
#include <string.h>
-#include "operand-int.h"
-#include "operands/immediate.h"
-#include "operands/targetable-int.h"
-#include "../analysis/routine.h"
-#include "../common/extstr.h"
-#include "../format/format.h"
-#include "../format/strsym.h"
-#include "../glibext/gbinarycursor.h"
+#include "immediate.h"
+#include "target-int.h"
+#include "targetable-int.h"
+#include "../../analysis/routine.h"
+#include "../../common/extstr.h"
+#include "../../format/format.h"
+#include "../../format/strsym.h"
+#include "../../glibext/gbinarycursor.h"
-/* Définition d'un opérande ciblant idéalement un symbole connu (instance) */
-struct _GTargetOperand
-{
- GArchOperand parent; /* Instance parente */
-
- MemoryDataSize size; /* Taille de l'opérande */
- vmpa2t addr; /* Adresse de l'élément visé */
-
- bool strict; /* Résolution stricte */
- /* Référence circulaire */
- GBinSymbol *symbol; /* Eventuel symbole associé */
- phys_t diff; /* Position dans le symbole */
-
-};
-
-
-/* Définition d'un opérande ciblant idéalement un symbole connu (classe) */
-struct _GTargetOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
/* Initialise la classe des opérandes ciblant des symboles. */
static void g_target_operand_class_init(GTargetOperandClass *);
diff --git a/src/arch/target.h b/src/arch/operands/target.h
index 1e72ad8..8810efa 100644
--- a/src/arch/target.h
+++ b/src/arch/operands/target.h
@@ -21,17 +21,17 @@
*/
-#ifndef _ARCH_TARGET_H
-#define _ARCH_TARGET_H
+#ifndef _ARCH_OPERANDS_TARGET_H
+#define _ARCH_OPERANDS_TARGET_H
#include <glib-object.h>
#include <stdbool.h>
-#include "archbase.h"
-#include "operand.h"
-#include "vmpa.h"
+#include "../archbase.h"
+#include "../operand.h"
+#include "../vmpa.h"
@@ -67,4 +67,4 @@ GBinSymbol *g_target_operand_get_symbol(const GTargetOperand *, phys_t *);
-#endif /* _ARCH_TARGET_H */
+#endif /* _ARCH_OPERANDS_TARGET_H */
diff --git a/src/arch/post.c b/src/arch/post.c
index 11fecf5..6f6392d 100644
--- a/src/arch/post.c
+++ b/src/arch/post.c
@@ -28,8 +28,8 @@
#include "processor.h"
-#include "target.h"
#include "operands/immediate.h"
+#include "operands/target.h"
#include "../analysis/routine.h"
diff --git a/src/arch/storage.c b/src/arch/storage.c
index 217d327..0995f4d 100644
--- a/src/arch/storage.c
+++ b/src/arch/storage.c
@@ -33,7 +33,7 @@
#include "instruction.h"
-#include "target.h"
+#include "operands/target.h"
#include "../common/compression.h"
#include "../common/extstr.h"
#include "../common/pathname.h"
diff --git a/src/core/processors.c b/src/core/processors.c
index 81f7494..3211009 100644
--- a/src/core/processors.c
+++ b/src/core/processors.c
@@ -29,11 +29,11 @@
#include <string.h>
-#include "../arch/target.h"
#include "../arch/instructions/raw.h"
#include "../arch/instructions/undefined.h"
#include "../arch/operands/immediate.h"
#include "../arch/operands/register.h"
+#include "../arch/operands/target.h"
@@ -78,6 +78,7 @@ void register_arch_gtypes(void)
g_type_ensure(G_TYPE_IMM_OPERAND);
g_type_ensure(G_TYPE_REGISTER_OPERAND);
+ g_type_ensure(G_TYPE_TARGET_OPERAND);
}