diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index e00921d2e..3dec3a00d 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -302,9 +302,8 @@ qfo_relocs (qfo_t *qfo) break; case rel_def_string: printf (" def@%d:%x string:%x `%s'", - reloc->space, reloc->offset, - QFO_STRING (qfo, reloc->space, reloc->offset), - QFO_GSTRING (qfo, reloc->space, reloc->offset)); + reloc->space, reloc->offset, reloc->target, + QFO_GETSTR (qfo, reloc->target)); break; case rel_def_field: def = qfo->defs + reloc->target; diff --git a/tools/qfcc/source/obj_file.c b/tools/qfcc/source/obj_file.c index d8de9c827..e54fca0e8 100644 --- a/tools/qfcc/source/obj_file.c +++ b/tools/qfcc/source/obj_file.c @@ -315,10 +315,16 @@ qfo_from_progs (pr_info_t *pr) qfo->num_loose_relocs = qfo->num_relocs - (reloc - qfo->relocs); for (r = pr->relocs; r; r = r->next) { - if (r->type == rel_def_op) + if (r->type == rel_def_op) { qfo_encode_one_reloc (r, &reloc, r->label->dest->offset); - else + } else if (r->type == rel_def_string) { + def_t d; + d.space = r->space; + d.offset = r->offset; + qfo_encode_one_reloc (r, &reloc, D_STRING (&d)); + } else { qfo_encode_one_reloc (r, &reloc, 0); + } } return qfo;