From 8d6c491390efc4261911934a6177a812c0f17308 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 17 Jul 2002 18:45:17 +0000 Subject: [PATCH] fix branches (been broken for a while :/) --- tools/qfcc/source/emit.c | 1 + tools/qfcc/source/linker.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index b3693f078..4eb829fa7 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -542,6 +542,7 @@ emit_expr (expr_t *e) case ex_label: label = &e->e.label; label->ofs = pr.code->size; + relocate_refs (label->refs, label->ofs); break; case ex_block: for (e = e->e.block.head; e; e = e->next) diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index c6c197da3..41320f907 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -140,10 +140,12 @@ add_relocs (qfo_t *qfo) case rel_op_a_def: case rel_op_b_def: case rel_op_c_def: + reloc->ofs += code_base; + break; case rel_op_a_op: case rel_op_b_op: case rel_op_c_op: - reloc->ofs += code_base; + // these are relative and fixed up before the .qfo is written break; case rel_def_op: reloc->ofs += data_base;