diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-10-01 22:10:38 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-10-01 22:10:38 +0000 |
commit | 65b3cbca1b730ecd835c6611773f0a9b00c49462 (patch) | |
tree | c341234b5d9916b9014fbd330eb6e3fcc994d9ec /libexec/ld.so | |
parent | ac494830e733bd8a0e288f159e4bf21afc63c8ce (diff) |
Fix GOT reloc which had flaws in reloc processing.
Big thanks to Mark Kettenis for finding the problem!
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/mips64/rtld_machine.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libexec/ld.so/mips64/rtld_machine.c b/libexec/ld.so/mips64/rtld_machine.c index 27c2c4fe3d9..ccc6ab05b95 100644 --- a/libexec/ld.so/mips64/rtld_machine.c +++ b/libexec/ld.so/mips64/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.4 2004/09/30 17:56:18 pefo Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.5 2004/10/01 22:10:37 pefo Exp $ */ /* * Copyright (c) 1998-2004 Opsycon AB, Sweden. @@ -250,10 +250,19 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) symp->st_size, object); if (this) *gotp = this->st_value + ooff; - } else if (ELF64_ST_TYPE(symp->st_info) == STT_FUNC) { + } else if (ELF64_ST_TYPE(symp->st_info) == STT_FUNC && + symp->st_value != *gotp) { *gotp += loff; - } else { /* XXX ??? */ /* Resolve all others immediatly */ - *gotp = symp->st_value + loff; + } else { /* Resolve all others immediatly */ + this = 0; + ooff = _dl_find_symbol(strt + symp->st_name, + _dl_objects, &this, NULL, + SYM_SEARCH_ALL|SYM_NOWARNNOTFOUND|SYM_PLT, + symp->st_size, object); + if (this) + *gotp = this->st_value + ooff; + else + *gotp = symp->st_value + loff; } gotp++; symp++; |