Fix an embarresing mistake in the kld symbol lookup for DDB. It should

now correctly do a traceback when crashing inside a KLD module.

PR:		15014
Submitted by:	Vladimir N. Silyaev <vns@delta.odessa.ua>
This commit is contained in:
Peter Wemm 1999-11-28 11:59:18 +00:00
parent 0efa204039
commit b5abfb708c
2 changed files with 12 additions and 8 deletions

View File

@ -958,17 +958,19 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
const Elf_Sym* es;
const Elf_Sym* best = 0;
int i;
u_long st_value;
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
if (es->st_name == 0)
continue;
if (off >= es->st_value) {
if (off - es->st_value < diff) {
diff = off - es->st_value;
st_value = es->st_value + (u_long)ef->address;
if (off >= st_value) {
if (off - st_value < diff) {
diff = off - st_value;
best = es;
if (diff == 0)
break;
} else if (off - es->st_value == diff) {
} else if (off - st_value == diff) {
best = es;
}
}

View File

@ -958,17 +958,19 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
const Elf_Sym* es;
const Elf_Sym* best = 0;
int i;
u_long st_value;
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
if (es->st_name == 0)
continue;
if (off >= es->st_value) {
if (off - es->st_value < diff) {
diff = off - es->st_value;
st_value = es->st_value + (u_long)ef->address;
if (off >= st_value) {
if (off - st_value < diff) {
diff = off - st_value;
best = es;
if (diff == 0)
break;
} else if (off - es->st_value == diff) {
} else if (off - st_value == diff) {
best = es;
}
}