Take a shot at implementing the fix for PR 15014 for the a.out kernel

linker as well.

PR:		15014
Submitted by:	Vladimir N. Silyaev <vns@delta.odessa.ua>
This commit is contained in:
peter 1999-11-28 12:06:29 +00:00
parent 348a0952c0
commit 6defa5e042

View File

@ -563,19 +563,21 @@ link_aout_search_symbol(linker_file_t lf, caddr_t value,
struct nzlist* sp;
struct nzlist* ep;
struct nzlist* best = 0;
u_long sp_nz_value;
for (sp = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic)),
ep = (struct nzlist *) ((caddr_t) sp + LD_STABSZ(af->dynamic));
sp < ep; sp++) {
if (sp->nz_name == 0)
continue;
if (off >= sp->nz_value) {
if (off - sp->nz_value < diff) {
diff = off - sp->nz_value;
sp_nz_value = sp->nz_value + (u_long)af->address;
if (off >= sp_nz_value) {
if (off - sp_nz_value < diff) {
diff = off - sp_nz_value;
best = sp;
if (diff == 0)
break;
} else if (off - sp->nz_value == diff) {
} else if (off - sp_nz_value == diff) {
best = sp;
}
}