mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-17 13:00:43 +08:00
Use D_PTR to access relocated entries in l_info.
This commit is contained in:
parent
17e74c26b7
commit
7189e3b807
@ -97,7 +97,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||
/* The GOT entries for the functions in the PLT have not been
|
||||
filled in yet. Their initial contents are directed to the
|
||||
PLT which arranges for the dynamic linker to be called. */
|
||||
plt = l->l_info[DT_PLTGOT]->d_un.d_ptr;
|
||||
plt = D_PTR (l, l_info[DT_PLTGOT]);
|
||||
|
||||
/* This function will be called to perform the relocation. */
|
||||
if (!profile)
|
||||
@ -349,8 +349,8 @@ elf_machine_fixup_plt(struct link_map *l, const Elf64_Rela *reloc,
|
||||
|
||||
/* Recover the PLT entry address by calculating reloc's index into the
|
||||
.rela.plt, and finding that entry in the .plt. */
|
||||
rela_plt = (void *) l->l_info[DT_JMPREL]->d_un.d_ptr;
|
||||
plte = (void *) (l->l_info[DT_PLTGOT]->d_un.d_ptr + 32);
|
||||
rela_plt = (void *) D_PTR (l, l_info[DT_JMPREL]);
|
||||
plte = (void *) (D_PTR (l, [DT_PLTGOT]) + 32);
|
||||
plte += 3 * (reloc - rela_plt);
|
||||
|
||||
/* Find the displacement from the plt entry to the function. */
|
||||
@ -480,7 +480,7 @@ elf_machine_rela (struct link_map *map,
|
||||
than the dynamic linker's built-in definitions used
|
||||
while loading those libraries. */
|
||||
const Elf64_Sym *const dlsymtab
|
||||
= (void *) map->l_info[DT_SYMTAB]->d_un.d_ptr;
|
||||
= (void *) D_PTR (map, l_info[DT_SYMTAB]);
|
||||
sym_value -= map->l_addr;
|
||||
sym_value -= dlsymtab[ELF64_R_SYM(reloc->r_info)].st_value;
|
||||
sym_value -= reloc->r_addend;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Machine-dependent ELF dynamic relocation inline functions. ARM version.
|
||||
Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995,96,97,98,99,2000 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
|
||||
@ -97,7 +97,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||
in. Their initial contents will arrange when called to push an
|
||||
index into the .got section, load ip with &_GLOBAL_OFFSET_TABLE_[3],
|
||||
and then jump to _GLOBAL_OFFSET_TABLE[2]. */
|
||||
got = (Elf32_Addr *) l->l_info[DT_PLTGOT]->d_un.d_ptr;
|
||||
got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
|
||||
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
|
||||
|
||||
/* The got[2] entry contains the address of a function which gets
|
||||
@ -413,7 +413,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
|
||||
{
|
||||
const char *strtab;
|
||||
|
||||
strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
|
||||
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
|
||||
": Symbol `", strtab + refsym->st_name,
|
||||
"' has different size in shared object, "
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
|
||||
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998, 1999, 2000 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
|
||||
@ -78,7 +78,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||
to push an offset into the .rela.plt section, push
|
||||
_GLOBAL_OFFSET_TABLE_[1], and then jump to
|
||||
_GLOBAL_OFFSET_TABLE_[2]. */
|
||||
got = (Elf32_Addr *) l->l_info[DT_PLTGOT]->d_un.d_ptr;
|
||||
got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
|
||||
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
|
||||
|
||||
/* The got[2] entry contains the address of a function which gets
|
||||
@ -289,7 +289,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
|
||||
extern char **_dl_argv;
|
||||
const char *strtab;
|
||||
|
||||
strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
|
||||
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
|
||||
": Symbol `", strtab + refsym->st_name,
|
||||
"' has different size in shared object, "
|
||||
|
Loading…
Reference in New Issue
Block a user