summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sparc64/rtld_machine.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2005-09-16 23:19:44 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2005-09-16 23:19:44 +0000
commitaf3616ed51f4eb0fd16d93f503c40bc80f7f50c3 (patch)
tree2580ab1dca2725647349467a20e61a10d25295e0 /libexec/ld.so/sparc64/rtld_machine.c
parent9d9cb5a7061046352d3c2131dcc90e03844265fc (diff)
Rework symbol lookup to more closely match sun's documentation, now
treats dlopens as load groups. ok kurt@
Diffstat (limited to 'libexec/ld.so/sparc64/rtld_machine.c')
-rw-r--r--libexec/ld.so/sparc64/rtld_machine.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/libexec/ld.so/sparc64/rtld_machine.c b/libexec/ld.so/sparc64/rtld_machine.c
index 5b45eb44dd9..92c92db08ac 100644
--- a/libexec/ld.so/sparc64/rtld_machine.c
+++ b/libexec/ld.so/sparc64/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.34 2004/05/25 21:42:48 mickey Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.35 2005/09/16 23:19:43 drahn Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -262,12 +262,11 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
} else {
this = NULL;
ooff = _dl_find_symbol_bysym(object,
- ELF_R_SYM(relas->r_info),
- _dl_objects, &this, NULL,
+ ELF_R_SYM(relas->r_info), &this,
SYM_SEARCH_ALL|SYM_WARNNOTFOUND|
((type == R_TYPE(JMP_SLOT)) ?
SYM_PLT : SYM_NOTPLT),
- sym->st_size);
+ sym->st_size, NULL);
if (this == NULL) {
resolve_failed:
_dl_printf("%s: %s: can't resolve "
@@ -293,9 +292,9 @@ resolve_failed:
size_t size = dstsym->st_size;
Elf_Addr soff;
- soff = _dl_find_symbol(symn, object->next, &srcsym,
- NULL, SYM_SEARCH_ALL|SYM_WARNNOTFOUND|SYM_NOTPLT,
- size, object);
+ soff = _dl_find_symbol(symn, &srcsym,
+ SYM_SEARCH_OTHER|SYM_WARNNOTFOUND|SYM_NOTPLT,
+ size, object, NULL);
if (srcsym == NULL)
goto resolve_failed;
@@ -622,8 +621,9 @@ _dl_bind(elf_object_t *object, int index)
addr = (Elf_Word *)(object->load_offs + rela->r_offset);
this = NULL;
- ooff = _dl_find_symbol(symn, _dl_objects, &this, NULL,
- SYM_SEARCH_ALL|SYM_WARNNOTFOUND|SYM_PLT, sym->st_size, object);
+ ooff = _dl_find_symbol(symn, &this,
+ SYM_SEARCH_ALL|SYM_WARNNOTFOUND|SYM_PLT, sym->st_size,
+ object, NULL);
if (this == NULL) {
_dl_printf("lazy binding failed!\n");
*((int *)0) = 0; /* XXX */
@@ -695,28 +695,32 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
object->got_addr = NULL;
object->got_size = 0;
this = NULL;
- ooff = _dl_find_symbol("__got_start", object, &this, NULL,
- SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND|SYM_PLT, 0, object);
+ ooff = _dl_find_symbol("__got_start", &this,
+ SYM_SEARCH_OBJ|SYM_NOWARNNOTFOUND|SYM_PLT, 0,
+ object, NULL);
if (this != NULL)
object->got_addr = ooff + this->st_value;
this = NULL;
- ooff = _dl_find_symbol("__got_end", object, &this, NULL,
- SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND|SYM_PLT, 0, object);
+ ooff = _dl_find_symbol("__got_end", &this,
+ SYM_SEARCH_OBJ|SYM_NOWARNNOTFOUND|SYM_PLT, 0,
+ object, NULL);
if (this != NULL)
object->got_size = ooff + this->st_value - object->got_addr;
plt_addr = 0;
object->plt_size = 0;
this = NULL;
- ooff = _dl_find_symbol("__plt_start", object, &this, NULL,
- SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND|SYM_PLT, 0, object);
+ ooff = _dl_find_symbol("__plt_start", &this,
+ SYM_SEARCH_OBJ|SYM_NOWARNNOTFOUND|SYM_PLT, 0,
+ object, NULL);
if (this != NULL)
plt_addr = ooff + this->st_value;
this = NULL;
- ooff = _dl_find_symbol("__plt_end", object, &this, NULL,
- SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND|SYM_PLT, 0, object);
+ ooff = _dl_find_symbol("__plt_end", &this,
+ SYM_SEARCH_OBJ|SYM_NOWARNNOTFOUND|SYM_PLT, 0,
+ object, NULL);
if (this != NULL)
object->plt_size = ooff + this->st_value - plt_addr;