summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-06-07 15:18:20 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-06-07 15:18:20 +0000
commitaaf1a21b032d5a8a898390a75bb0008c4bc1b8fb (patch)
treef04e6b80debd9c207781211ea514268d438b9a4e /libexec
parent04fb078cd155fa471954235ed9fe677d2ee6db62 (diff)
fixup the dlsym() return to produce a callable address (plabel) and move one comment closer to the code it talks about earlier; drahn@ ok
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/dlfcn.c14
-rw-r--r--libexec/ld.so/hppa/archdep.h3
2 files changed, 12 insertions, 5 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index e798d128fd7..ede4a44aa5a 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.37 2004/06/07 15:00:38 mickey Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.38 2004/06/07 15:18:19 mickey Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -59,11 +59,11 @@ dlopen(const char *libname, int flags)
_dl_thread_kern_stop();
object = _dl_load_shlib(libname, _dl_objects, OBJTYPE_DLO, flags);
- /* this add_object should not be here, XXX */
if (object == 0) {
_dl_thread_kern_go();
return((void *)0);
}
+ /* this add_object should not be here, XXX */
_dl_add_object(object);
_dl_link_sub(object, _dl_objects);
_dl_thread_kern_go();
@@ -142,9 +142,15 @@ dlsym(void *handle, const char *name)
retval = (void *)_dl_find_symbol(name, object, &sym, NULL,
SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND|SYM_NOTPLT, 0, object);
- if (sym != NULL)
+ if (sym != NULL) {
retval += sym->st_value;
- else
+#ifdef __hppa__
+ retval = (void *)_dl_md_plabel((Elf_Addr)retval,
+ object->dyn.pltgot);
+#endif
+ DL_DEB(("dlsym: %s in %s: %p\n",
+ name, object->load_name, retval));
+ } else
_dl_errno = DL_NO_SYMBOL;
return (retval);
}
diff --git a/libexec/ld.so/hppa/archdep.h b/libexec/ld.so/hppa/archdep.h
index 655acccc27b..a5008bb9f74 100644
--- a/libexec/ld.so/hppa/archdep.h
+++ b/libexec/ld.so/hppa/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.1 2004/05/25 21:48:00 mickey Exp $ */
+/* $OpenBSD: archdep.h,v 1.2 2004/06/07 15:18:19 mickey Exp $ */
/*
* Copyright (c) 2004 Michael Shalayeff
@@ -95,5 +95,6 @@ RELOC_RELA(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
void _hppa_dl_dtors(void);
void hppa_call(void *, Elf_Addr *, void (*)(void));
+Elf_Addr _dl_md_plabel(Elf_Addr, Elf_Addr *);
#endif /* _HPPA_ARCHDEP_H_ */