diff options
author | peter <peter@FreeBSD.org> | 2004-05-16 20:00:28 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-05-16 20:00:28 +0000 |
commit | ea4215c5218f4d79c33e806304e35cc951ea3dc7 (patch) | |
tree | 9c824fecb4de303fa016d7216c651ec04ecaec13 /sys/sparc64 | |
parent | 1eee96e5b10a90bb98c51684bf6fa7c4b4d1c57f (diff) | |
download | FreeBSD-src-ea4215c5218f4d79c33e806304e35cc951ea3dc7.zip FreeBSD-src-ea4215c5218f4d79c33e806304e35cc951ea3dc7.tar.gz |
Make a small revision to the api between the elf linker core and the
elf_reloc() backends for two reasons. First, to support the possibility
of there being two elf linkers in the kernel (eg: amd64), and second, to
pass the relocbase explicitly (for relocating .o format kld files).
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/elf_machdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c index d9d2974..a20442a 100644 --- a/sys/sparc64/sparc64/elf_machdep.c +++ b/sys/sparc64/sparc64/elf_machdep.c @@ -252,7 +252,8 @@ static long reloc_target_bitmask[] = { #define RELOC_VALUE_BITMASK(t) (reloc_target_bitmask[t]) int -elf_reloc_local(linker_file_t lf, const void *data, int type) +elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data, + int type, elf_lookup_fn lookup) { const Elf_Rela *rela; Elf_Addr value; @@ -275,7 +276,8 @@ elf_reloc_local(linker_file_t lf, const void *data, int type) /* Process one elf relocation with addend. */ int -elf_reloc(linker_file_t lf, const void *data, int type) +elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, + elf_lookup_fn lookup) { const Elf_Rela *rela; Elf_Addr relocbase; @@ -289,7 +291,6 @@ elf_reloc(linker_file_t lf, const void *data, int type) if (type != ELF_RELOC_RELA) return (-1); - relocbase = (Elf_Addr)lf->address; rela = (const Elf_Rela *)data; where = (Elf_Addr *)(relocbase + rela->r_offset); where32 = (Elf_Half *)where; @@ -309,7 +310,7 @@ elf_reloc(linker_file_t lf, const void *data, int type) value = rela->r_addend; if (RELOC_RESOLVE_SYMBOL(rtype)) { - addr = elf_lookup(lf, symidx, 1); + addr = lookup(lf, symidx, 1); if (addr == 0) return (-1); value += addr; |