summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-26 18:43:07 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-26 18:43:07 +0000
commitbad460060180064bc08a00c589581bf5f43ebfa8 (patch)
tree5a0439df998ba42e2a078e3e8b50c37738f23dbd /libexec/ld.so
parent3a50473acb5284be68a98e0a4ad1eb25a3436fd0 (diff)
Lazy binding for shared libraries.
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/alpha/rtld_machine.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libexec/ld.so/alpha/rtld_machine.c b/libexec/ld.so/alpha/rtld_machine.c
index 1620ca5def5..bec720d9f21 100644
--- a/libexec/ld.so/alpha/rtld_machine.c
+++ b/libexec/ld.so/alpha/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.7 2001/06/13 08:45:34 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.8 2001/06/26 18:43:06 art Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -216,11 +216,25 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
pltgot = (Elf_Addr *)object->Dyn.info[DT_PLTGOT];
- if (object->obj_type != OBJTYPE_EXE || !lazy || pltgot == NULL) {
+ if (object->obj_type == OBJTYPE_LDR || !lazy || pltgot == NULL) {
_dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ);
return;
}
+ if (object->obj_type != OBJTYPE_EXE) {
+ int i, size;
+ Elf_Addr *addr;
+ Elf_RelA *rela;
+
+ size = object->Dyn.info[DT_PLTRELSZ] / sizeof(Elf_RelA);
+ rela = (Elf_RelA *)(object->Dyn.info[DT_JMPREL]);
+
+ for (i = 0; i < size; i++) {
+ addr = (Elf_Addr *)(object->load_offs + rela[i].r_offset);
+ *addr += object->load_offs;
+ }
+ }
+
pltgot[2] = (Elf_Addr)_dl_bind_start;
pltgot[3] = (Elf_Addr)object;
}