[qfcc] Fix infinite loop in linker

This commit is contained in:
Bill Currie 2020-02-29 20:13:25 +09:00
parent 8b6d05a4dd
commit e93ca9d828
1 changed files with 5 additions and 6 deletions

View File

@ -1122,12 +1122,11 @@ undefined_def (qfo_def_t *def)
if (func->code < 0) {
continue;
}
if ((pr_uint_t) func->code > reloc->offset) {
continue;
}
if (!best || reloc->offset - func->code < best_dist) {
best = func;
best_dist = reloc->offset - func->code;
if ((pr_uint_t) func->code <= reloc->offset) {
if (!best || reloc->offset - func->code < best_dist) {
best = func;
best_dist = reloc->offset - func->code;
}
}
func++;
}