summaryrefslogtreecommitdiff
path: root/src/arch/post.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-04-22 21:53:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-04-22 21:53:07 (GMT)
commit9c1367eb2e75dfac59f33e851dee8d39542072ac (patch)
treedd999e736e12c47d9d0b90808451d14c6279a85d /src/arch/post.c
parenta2979604ebaa3d564908f13e4f9ab345fca0ff28 (diff)
Shared target operands in memory when possible.
Diffstat (limited to 'src/arch/post.c')
-rw-r--r--src/arch/post.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/post.c b/src/arch/post.c
index 184430d..1463709 100644
--- a/src/arch/post.c
+++ b/src/arch/post.c
@@ -55,7 +55,7 @@ void post_process_target_resolution(GArchInstruction *instr, GArchProcessor *pro
virt_t addr; /* Adresse visée par le saut */
GBinFormat *bfmt; /* Version basique du format */
MemoryDataSize ptr_size; /* Taille de l'espace mémoire */
- GArchOperand *new; /* Instruction de ciblage */
+ GTargetOperand *new; /* Instruction de ciblage */
vmpa2t target; /* Emplacement de la cible */
mrange_t trange; /* Etendue du symbole à créer */
VMPA_BUFFER(loc); /* Conversion en chaîne */
@@ -75,9 +75,9 @@ void post_process_target_resolution(GArchInstruction *instr, GArchProcessor *pro
ptr_size = g_arch_processor_get_memory_size(proc);
- new = g_target_operand_new(ptr_size, &target);
+ new = G_TARGET_OPERAND(g_target_operand_new(ptr_size, &target));
- if (!g_target_operand_resolve(G_TARGET_OPERAND(new), bfmt, true))
+ if (!g_target_operand_resolve(&new, bfmt, true, NULL))
{
vmpa2_to_string(&target, MDS_UNDEFINED, loc, NULL);
@@ -107,11 +107,11 @@ void post_process_target_resolution(GArchInstruction *instr, GArchProcessor *pro
g_binary_symbol_attach_routine(symbol, routine);
g_binary_format_add_symbol(bfmt, symbol);
- g_target_operand_resolve(G_TARGET_OPERAND(new), bfmt, true);
+ g_target_operand_resolve(&new, bfmt, true, NULL);
}
- _g_arch_instruction_replace_operand(instr, op, new);
+ _g_arch_instruction_replace_operand(instr, op, G_ARCH_OPERAND(new));
}