diff options
Diffstat (limited to 'elf/dl-runtime.c')
-rw-r--r-- | elf/dl-runtime.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index 91700c2764..a0f54bd3fc 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,13 +48,11 @@ fixup ( struct link_map *l, ElfW(Word) reloc_offset) { const ElfW(Sym) *const symtab - = (const ElfW(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 void *) l->l_info[DT_SYMTAB]->d_un.d_ptr; + const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr; const PLTREL *const reloc - = (const void *) (l->l_addr + l->l_info[DT_JMPREL]->d_un.d_ptr + - reloc_offset); + = (const void *) (l->l_info[DT_JMPREL]->d_un.d_ptr + reloc_offset); const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)]; void *const rel_addr = (void *)(l->l_addr + reloc->r_offset); ElfW(Addr) value; @@ -67,8 +65,8 @@ fixup ( { default: { - const ElfW(Half) *vernum = (const ElfW(Half) *) - (l->l_addr + l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr); + const ElfW(Half) *vernum = + (const void *) l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr; ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)]; const struct r_found_version *version = &l->l_versions[ndx]; @@ -121,13 +119,11 @@ profile_fixup ( { /* This is the first time we have to relocate this object. */ const ElfW(Sym) *const symtab - = (const ElfW(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 void *) l->l_info[DT_SYMTAB]->d_un.d_ptr; + const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr; const PLTREL *const reloc - = (const void *) (l->l_addr + l->l_info[DT_JMPREL]->d_un.d_ptr + - reloc_offset); + = (const void *) (l->l_info[DT_JMPREL]->d_un.d_ptr + reloc_offset); const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)]; /* Sanity check that we're really looking at a PLT relocation. */ @@ -138,8 +134,8 @@ profile_fixup ( { default: { - const ElfW(Half) *vernum = (const ElfW(Half) *) - (l->l_addr + l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr); + const ElfW(Half) *vernum = + (const void *) l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr; ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)]; const struct r_found_version *version = &l->l_versions[ndx]; |