summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sparc/rtld_machine.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-08-11 16:51:05 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-08-11 16:51:05 +0000
commit473832b4224d696359623031c03115a7f9c5a702 (patch)
tree2da7c2487a20a2b825c3c3e0d41cb15be5d6709b /libexec/ld.so/sparc/rtld_machine.c
parent8f0370394306356488cffa83b9a1e2de8282b759 (diff)
Fix for Elfbug, the Xtiherit problem which has been seen on most OpenBSD
ELF dynamic systems. This was due to an oddity in ELF where the address of fuctions refer to the PLT address in the program, rather than the actual function address.
Diffstat (limited to 'libexec/ld.so/sparc/rtld_machine.c')
-rw-r--r--libexec/ld.so/sparc/rtld_machine.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c
index f6cce421f58..b67826de258 100644
--- a/libexec/ld.so/sparc/rtld_machine.c
+++ b/libexec/ld.so/sparc/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.5 2002/08/09 14:38:23 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.6 2002/08/11 16:51:04 drahn Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -254,7 +254,8 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
} else {
this = NULL;
ooff = _dl_find_symbol(symn,
- _dl_objects, &this, 0, 1);
+ _dl_objects, &this, 0, 1,
+ type == R_TYPE(JMP_SLOT));
if (this == NULL) {
resolve_failed:
_dl_printf("%s: %s: can't resolve "
@@ -291,7 +292,7 @@ resolve_failed:
Elf_Addr soff;
soff = _dl_find_symbol(symn, object->next, &srcsym,
- 0, 2);
+ 0, 2, 0);
if (srcsym == NULL)
goto resolve_failed;
@@ -348,7 +349,7 @@ _dl_bind(elf_object_t *object, Elf_Word reloff)
symn = object->dyn.strtab + sym->st_name;
addr = (Elf_Addr *)(object->load_offs + rela->r_offset);
- ooff = _dl_find_symbol(symn, _dl_objects, &this, 0, 1);
+ ooff = _dl_find_symbol(symn, _dl_objects, &this, 0, 1, 1);
if (this == NULL) {
_dl_printf("lazy binding failed!\n");
*((int *)0) = 0; /* XXX */