mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
2000-03-24 Andreas Jaeger <aj@suse.de>
* sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Use D_PTR to access relocated entries in l_info. (elf_machine_got_rel): Likewise. (elf_machine_runtime_setup): Likewise. * sysdeps/mips/mips64/dl-machine.h (elf_machine_got_rel): Likewise. (elf_machine_runtime_setup): Likewise. (__dl_runtime_resolve): Likewise.
This commit is contained in:
@@ -224,11 +224,11 @@ __dl_runtime_resolve (ElfW(Word) sym_index, \
|
|||||||
{ \
|
{ \
|
||||||
struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); \
|
struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); \
|
||||||
const ElfW(Sym) *const symtab \
|
const ElfW(Sym) *const symtab \
|
||||||
= (const void *) l->l_info[DT_SYMTAB]->d_un.d_ptr; \
|
= (const void *) D_PTR (l, l_info[DT_SYMTAB]); \
|
||||||
const char *strtab \
|
const char *strtab \
|
||||||
= (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr; \
|
= (const void *) D_PTR (l, l_info[DT_STRTAB]); \
|
||||||
const ElfW(Addr) *got \
|
const ElfW(Addr) *got \
|
||||||
= (const ElfW(Addr) *) l->l_info[DT_PLTGOT]->d_un.d_ptr; \
|
= (const ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); \
|
||||||
const ElfW(Word) local_gotno \
|
const ElfW(Word) local_gotno \
|
||||||
= (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \
|
= (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \
|
||||||
const ElfW(Word) gotsym \
|
const ElfW(Word) gotsym \
|
||||||
@@ -483,7 +483,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
ElfW(Addr) *got;
|
ElfW(Addr) *got;
|
||||||
ElfW(Sym) *sym;
|
ElfW(Sym) *sym;
|
||||||
int i, n;
|
int i, n;
|
||||||
const char *strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
|
const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||||
|
|
||||||
#define RESOLVE_GOTSYM(sym) \
|
#define RESOLVE_GOTSYM(sym) \
|
||||||
({ \
|
({ \
|
||||||
@@ -495,7 +495,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
(ref)? sym_loadaddr + ref->st_value: 0; \
|
(ref)? sym_loadaddr + ref->st_value: 0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
got = (ElfW(Addr) *) map->l_info[DT_PLTGOT]->d_un.d_ptr;
|
got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]);
|
||||||
|
|
||||||
/* got[0] is reserved. got[1] is also reserved for the dynamic object
|
/* got[0] is reserved. got[1] is also reserved for the dynamic object
|
||||||
generated by gnu ld. Skip these reserved entries from relocation. */
|
generated by gnu ld. Skip these reserved entries from relocation. */
|
||||||
@@ -507,7 +507,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
|
|
||||||
/* Handle global got entries. */
|
/* Handle global got entries. */
|
||||||
got += n;
|
got += n;
|
||||||
sym = (void *) map->l_info[DT_SYMTAB]->d_un.d_ptr;
|
sym = (void *) D_PTR (map, l_info[DT_SYMTAB]);
|
||||||
sym += map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;
|
sym += map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;
|
||||||
i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val
|
i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val
|
||||||
- map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val);
|
- map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val);
|
||||||
@@ -566,7 +566,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|||||||
Their initial contents will arrange when called to put an
|
Their initial contents will arrange when called to put an
|
||||||
offset into the .dynsym section in t8, the return address
|
offset into the .dynsym section in t8, the return address
|
||||||
in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */
|
in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */
|
||||||
got = (ElfW(Addr) *) l->l_info[DT_PLTGOT]->d_un.d_ptr;
|
got = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
|
||||||
|
|
||||||
/* This function will get called to fix up the GOT entry indicated by
|
/* This function will get called to fix up the GOT entry indicated by
|
||||||
the register t8, and then jump to the resolved address. */
|
the register t8, and then jump to the resolved address. */
|
||||||
|
@@ -137,7 +137,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
ElfW(Addr) *got;
|
ElfW(Addr) *got;
|
||||||
ElfW(Sym) *sym;
|
ElfW(Sym) *sym;
|
||||||
int i, n;
|
int i, n;
|
||||||
const char *strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
|
const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||||
|
|
||||||
#define RESOLVE_GOTSYM(sym) \
|
#define RESOLVE_GOTSYM(sym) \
|
||||||
({ \
|
({ \
|
||||||
@@ -149,7 +149,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
(ref)? sym_loadaddr + ref->st_value: 0; \
|
(ref)? sym_loadaddr + ref->st_value: 0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
got = (ElfW(Addr) *) map->l_info[DT_PLTGOT]->d_un.d_ptr;
|
got = (ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]);
|
||||||
|
|
||||||
/* got[0] is reserved. got[1] is also reserved for the dynamic object
|
/* got[0] is reserved. got[1] is also reserved for the dynamic object
|
||||||
generated by gnu ld. Skip these reserved entries from relocation. */
|
generated by gnu ld. Skip these reserved entries from relocation. */
|
||||||
@@ -161,7 +161,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
|
|
||||||
/* Handle global got entries. */
|
/* Handle global got entries. */
|
||||||
got += n;
|
got += n;
|
||||||
sym = (ElfW(Sym) *) map->l_info[DT_SYMTAB]->d_un.d_ptr;
|
sym = (ElfW(Sym) *) D_PTR (map, l_info[DT_SYMTAB]);
|
||||||
sym += map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;
|
sym += map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;
|
||||||
i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val
|
i = (map->l_info[DT_MIPS (SYMTABNO)]->d_un.d_val
|
||||||
- map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val);
|
- map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val);
|
||||||
@@ -224,7 +224,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|||||||
Their initial contents will arrange when called to put an
|
Their initial contents will arrange when called to put an
|
||||||
offset into the .dynsym section in t8, the return address
|
offset into the .dynsym section in t8, the return address
|
||||||
in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */
|
in t7 and then jump to _GLOBAL_OFFSET_TABLE[0]. */
|
||||||
got = (ElfW(Addr) *) l->l_info[DT_PLTGOT]->d_un.d_ptr;
|
got = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
|
||||||
|
|
||||||
/* This function will get called to fix up the GOT entry indicated by
|
/* This function will get called to fix up the GOT entry indicated by
|
||||||
the register t8, and then jump to the resolved address. */
|
the register t8, and then jump to the resolved address. */
|
||||||
@@ -337,10 +337,10 @@ __dl_runtime_resolve (ElfW(Word) sym_index, \
|
|||||||
{ \
|
{ \
|
||||||
struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); \
|
struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc); \
|
||||||
const ElfW(Sym) *const symtab \
|
const ElfW(Sym) *const symtab \
|
||||||
= (const ElfW(Sym) *) l->l_info[DT_SYMTAB]->d_un.d_ptr; \
|
= (const ElfW(Sym) *) D_PTR (l, l_info[DT_SYMTAB]); \
|
||||||
const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr; \
|
const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); \
|
||||||
const ElfW(Addr) *got \
|
const ElfW(Addr) *got \
|
||||||
= (const ElfW(Addr) *) l->l_info[DT_PLTGOT]->d_un.d_ptr; \
|
= (const ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]); \
|
||||||
const ElfW(Word) local_gotno \
|
const ElfW(Word) local_gotno \
|
||||||
= (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \
|
= (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; \
|
||||||
const ElfW(Word) gotsym \
|
const ElfW(Word) gotsym \
|
||||||
|
Reference in New Issue
Block a user