Fix symbol lookups between modules. This caused modules that depend on

other modules to explode.  eg: snd_ich->snd_pcm and umass->usb.
The problem was that I was using the unified base address of the module
instead of finding the start address of the section in question.
This commit is contained in:
Peter Wemm 2004-06-15 01:35:57 +00:00
parent add21e178f
commit 1cab0c857e

View File

@ -747,12 +747,16 @@ static int
link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym,
linker_symval_t *symval)
{
Elf_Addr base;
elf_file_t ef = (elf_file_t) lf;
const Elf_Sym *es = (const Elf_Sym*) sym;
if (es >= ef->ddbsymtab && es < (ef->ddbsymtab + ef->ddbsymcnt)) {
base = findbase(ef, es->st_shndx);
if (base == 0)
base = (Elf_Addr)ef->address;
symval->name = ef->ddbstrtab + es->st_name;
symval->value = (caddr_t) ef->address + es->st_value;
symval->value = (caddr_t)base + es->st_value;
symval->size = es->st_size;
return 0;
}