summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf_obj.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-06-15 01:35:57 +0000
committerpeter <peter@FreeBSD.org>2004-06-15 01:35:57 +0000
commit0d395ced064ef2b8552aa3cac8df26f23da67356 (patch)
tree6bac90da716c44ce0a168f5ab23c21214b9e6861 /sys/kern/link_elf_obj.c
parent99c1fd6c774c9ab31185fcf3f8bdc3a13a543558 (diff)
downloadFreeBSD-src-0d395ced064ef2b8552aa3cac8df26f23da67356.zip
FreeBSD-src-0d395ced064ef2b8552aa3cac8df26f23da67356.tar.gz
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.
Diffstat (limited to 'sys/kern/link_elf_obj.c')
-rw-r--r--sys/kern/link_elf_obj.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 0c6c4f9..41417cd 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -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;
}
OpenPOWER on IntegriCloud