mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Correctly update the offset of code relocs.
This commit is contained in:
parent
7fd839a5ed
commit
fe7be543f8
1 changed files with 10 additions and 2 deletions
|
@ -319,8 +319,12 @@ add_relocs (qfo_t *qfo, int start, int count, int target)
|
|||
continue;
|
||||
}
|
||||
reloc->space = qfo->spaces[reloc->space].id;
|
||||
if (reloc->space < qfo_num_spaces)
|
||||
if (!reloc->space) {
|
||||
//FIXME double check
|
||||
reloc->offset += work_base[qfo_code_space];
|
||||
} else if (reloc->space < qfo_num_spaces) {
|
||||
reloc->offset += work_base[reloc->space];
|
||||
}
|
||||
reloc->target = target;
|
||||
}
|
||||
return work->num_relocs - count;
|
||||
|
@ -802,8 +806,12 @@ process_loose_relocs (qfo_t *qfo)
|
|||
const char *str = QFO_GSTRING (qfo, reloc->space, reloc->offset);
|
||||
reloc->target = linker_add_string (str);
|
||||
}
|
||||
if (reloc->space < qfo_num_spaces)
|
||||
if (!reloc->space) {
|
||||
//FIXME double check
|
||||
reloc->offset += work_base[qfo_code_space];
|
||||
} else if (reloc->space < qfo_num_spaces) {
|
||||
reloc->offset += work_base[reloc->space];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue