about summary refs log tree commit diff
path: root/sysdeps/i386/dl-runtime.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-05-31 13:23:14 +0000
committerRoland McGrath <roland@gnu.org>1995-05-31 13:23:14 +0000
commita1a9d215963c548aef245cacd8efa944de69503b (patch)
treeff96263310f3c2e3c1f90d4ec8b332b7af028d84 /sysdeps/i386/dl-runtime.c
parent4174072112e4e2b43cc65a5093a433b4270aed49 (diff)
downloadglibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.gz
glibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.xz
glibc-a1a9d215963c548aef245cacd8efa944de69503b.zip
Tue May 30 15:52:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* mach/Makefile (server-interfaces): Removed notify and
 	device_reply.  For shlibs with eager binding, libmachuser.so must
 	not refer to any functions not defined in libc.
Diffstat (limited to 'sysdeps/i386/dl-runtime.c')
-rw-r--r--sysdeps/i386/dl-runtime.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/i386/dl-runtime.c b/sysdeps/i386/dl-runtime.c
index 1bc569760c..8e218e2a62 100644
--- a/sysdeps/i386/dl-runtime.c
+++ b/sysdeps/i386/dl-runtime.c
@@ -34,15 +34,16 @@ void
 _dl_runtime_resolve (Elf32_Word reloc_offset)
 {
   __label__ return_insn;
-  struct link_map *l = (void *) &(&reloc_offset)[-1];
+  struct link_map *l = (void *) (&reloc_offset)[-1];
 
   const Elf32_Sym *const symtab
-    = (const Elf32_Sym *) l->l_info[DT_SYMTAB]->d_un.d_ptr;
-  const char *strtab
-    = ((void *) l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr);
+    = (const Elf32_Sym *) (l->l_addr + l->l_info[DT_SYMTAB]->d_un.d_ptr);
+  const char *strtab =
+    (const char *) (l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr);
 
-  const Elf32_Rel *const reloc = (void *) (l->l_info[DT_JMPREL]->d_un.d_ptr
-					   + reloc_offset);
+  const Elf32_Rel *const reloc
+    = (const void *) (l->l_addr + l->l_info[DT_JMPREL]->d_un.d_ptr +
+		      reloc_offset);
 
   const Elf32_Sym *definer;
   Elf32_Addr loadbase;
@@ -83,7 +84,7 @@ _dl_runtime_resolve (Elf32_Word reloc_offset)
      referred to by this PLT entry; once "ret" pops this address, the
      function in the shared object will run with the stack arranged just as
      when the user entered the PLT.  */
-  (&reloc_offset)[0] = *(Elf32_Word *) reloc->r_offset;
+  (&reloc_offset)[0] = *(Elf32_Word *) (l->l_addr + reloc->r_offset);
 
   return;