summaryrefslogtreecommitdiff
path: root/libexec/ld.so/arm/rtld_machine.c
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2008-04-09 21:45:27 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2008-04-09 21:45:27 +0000
commite8fa3db80c2b63ccd534533dd3faba4cea7228b8 (patch)
tree576d27cf7bc73facdc4c3316c2b0c99491e0e78d /libexec/ld.so/arm/rtld_machine.c
parent2649d5c18f001d23bb274cca5b01e455722dcc89 (diff)
Improve support for shared libs linked at non-zero addreses:
- rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base. With help and okay drahn@
Diffstat (limited to 'libexec/ld.so/arm/rtld_machine.c')
-rw-r--r--libexec/ld.so/arm/rtld_machine.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ld.so/arm/rtld_machine.c b/libexec/ld.so/arm/rtld_machine.c
index 19efa9ea06e..c509275acae 100644
--- a/libexec/ld.so/arm/rtld_machine.c
+++ b/libexec/ld.so/arm/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.13 2008/02/24 15:47:47 drahn Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.14 2008/04/09 21:45:26 kurt Exp $ */
/*
* Copyright (c) 2004 Dale Rahn
@@ -166,7 +166,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz)
Elf_Rel *rels;
struct load_list *llist;
- loff = object->load_offs;
+ loff = object->obj_base;
numrel = object->Dyn.info[relsz] / sizeof(Elf_Rel);
rels = (Elf_Rel *)(object->Dyn.info[rel]);
@@ -365,8 +365,8 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
for (i = 0; i < num/sizeof(Elf_Rel); i++, rel++) {
Elf_Addr *where;
- where = (Elf_Addr *)(rel->r_offset + object->load_offs);
- *where += object->load_offs;
+ where = (Elf_Addr *)(rel->r_offset + object->obj_base);
+ *where += object->obj_base;
}
pltgot[1] = (Elf_Addr)object;
@@ -407,7 +407,7 @@ _dl_bind(elf_object_t *object, int relidx)
*((int *)0) = 0; /* XXX */
}
- addr = (Elf_Addr *)(object->load_offs + rel->r_offset);
+ addr = (Elf_Addr *)(object->obj_base + rel->r_offset);
newval = ooff + this->st_value;
/* if GOT is protected, allow the write */