mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 14:00:30 +00:00
(ELF_MACHINE_NO_PLT): New defined macro.
(elf_machine_got_rel): Remove scope variable. Use scope from the map. Don't modify _dl_global_scope_end in the end. (__dl_runtime_resolv): Also use scope from the map.
This commit is contained in:
parent
1173aab2d2
commit
3f72bf96a9
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#define ELF_MACHINE_NAME "MIPS"
|
#define ELF_MACHINE_NAME "MIPS"
|
||||||
|
|
||||||
|
#define ELF_MACHINE_NO_PLT
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <entry.h>
|
#include <entry.h>
|
||||||
|
|
||||||
@ -142,7 +144,6 @@ 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;
|
||||||
struct link_map **scope;
|
|
||||||
const char *strtab
|
const char *strtab
|
||||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||||
|
|
||||||
@ -150,7 +151,8 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
({ \
|
({ \
|
||||||
const ElfW(Sym) *ref = sym; \
|
const ElfW(Sym) *ref = sym; \
|
||||||
ElfW(Addr) sym_loadaddr; \
|
ElfW(Addr) sym_loadaddr; \
|
||||||
sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, scope, \
|
sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, \
|
||||||
|
map->l_scope, \
|
||||||
map->l_name, ELF_MACHINE_RELOC_NOPLT);\
|
map->l_name, ELF_MACHINE_RELOC_NOPLT);\
|
||||||
(ref)? sym_loadaddr + ref->st_value: 0; \
|
(ref)? sym_loadaddr + ref->st_value: 0; \
|
||||||
})
|
})
|
||||||
@ -166,9 +168,6 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
while (i < n)
|
while (i < n)
|
||||||
got[i++] += map->l_addr;
|
got[i++] += map->l_addr;
|
||||||
|
|
||||||
/* Set scope. */
|
|
||||||
scope = _dl_object_relocation_scope (map);
|
|
||||||
|
|
||||||
/* Handle global got entries. */
|
/* Handle global got entries. */
|
||||||
got += n;
|
got += n;
|
||||||
sym = (ElfW(Sym) *) ((void *) map->l_addr
|
sym = (ElfW(Sym) *) ((void *) map->l_addr
|
||||||
@ -210,7 +209,6 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#undef RESOLVE_GOTSYM
|
#undef RESOLVE_GOTSYM
|
||||||
*_dl_global_scope_end = NULL;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -362,16 +360,13 @@ __dl_runtime_resolve (ElfW(Word) sym_index, \
|
|||||||
const ElfW(Sym) *definer; \
|
const ElfW(Sym) *definer; \
|
||||||
ElfW(Addr) loadbase; \
|
ElfW(Addr) loadbase; \
|
||||||
ElfW(Addr) funcaddr; \
|
ElfW(Addr) funcaddr; \
|
||||||
struct link_map **scope; \
|
|
||||||
\
|
\
|
||||||
/* Look up the symbol's run-time value. */ \
|
/* Look up the symbol's run-time value. */ \
|
||||||
scope = _dl_object_relocation_scope (l); \
|
|
||||||
definer = &symtab[sym_index]; \
|
definer = &symtab[sym_index]; \
|
||||||
\
|
\
|
||||||
loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer, \
|
loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer, \
|
||||||
scope, l->l_name, ELF_MACHINE_RELOC_NOPLT); \
|
l->l_scope, l->l_name, \
|
||||||
\
|
ELF_MACHINE_RELOC_NOPLT); \
|
||||||
*_dl_global_scope_end = NULL; \
|
|
||||||
\
|
\
|
||||||
/* Apply the relocation with that value. */ \
|
/* Apply the relocation with that value. */ \
|
||||||
funcaddr = loadbase + definer->st_value; \
|
funcaddr = loadbase + definer->st_value; \
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#define ELF_MACHINE_NAME "MIPS"
|
#define ELF_MACHINE_NAME "MIPS"
|
||||||
|
|
||||||
|
#define ELF_MACHINE_NO_PLT
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <entry.h>
|
#include <entry.h>
|
||||||
|
|
||||||
@ -142,7 +144,6 @@ 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;
|
||||||
struct link_map **scope;
|
|
||||||
const char *strtab
|
const char *strtab
|
||||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||||
|
|
||||||
@ -150,7 +151,8 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
({ \
|
({ \
|
||||||
const ElfW(Sym) *ref = sym; \
|
const ElfW(Sym) *ref = sym; \
|
||||||
ElfW(Addr) sym_loadaddr; \
|
ElfW(Addr) sym_loadaddr; \
|
||||||
sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, scope, \
|
sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, \
|
||||||
|
map->l_scope, \
|
||||||
map->l_name, ELF_MACHINE_RELOC_NOPLT);\
|
map->l_name, ELF_MACHINE_RELOC_NOPLT);\
|
||||||
(ref)? sym_loadaddr + ref->st_value: 0; \
|
(ref)? sym_loadaddr + ref->st_value: 0; \
|
||||||
})
|
})
|
||||||
@ -166,9 +168,6 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
while (i < n)
|
while (i < n)
|
||||||
got[i++] += map->l_addr;
|
got[i++] += map->l_addr;
|
||||||
|
|
||||||
/* Set scope. */
|
|
||||||
scope = _dl_object_relocation_scope (map);
|
|
||||||
|
|
||||||
/* Handle global got entries. */
|
/* Handle global got entries. */
|
||||||
got += n;
|
got += n;
|
||||||
sym = (ElfW(Sym) *) ((void *) map->l_addr
|
sym = (ElfW(Sym) *) ((void *) map->l_addr
|
||||||
@ -210,7 +209,6 @@ elf_machine_got_rel (struct link_map *map, int lazy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#undef RESOLVE_GOTSYM
|
#undef RESOLVE_GOTSYM
|
||||||
*_dl_global_scope_end = NULL;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -362,16 +360,13 @@ __dl_runtime_resolve (ElfW(Word) sym_index, \
|
|||||||
const ElfW(Sym) *definer; \
|
const ElfW(Sym) *definer; \
|
||||||
ElfW(Addr) loadbase; \
|
ElfW(Addr) loadbase; \
|
||||||
ElfW(Addr) funcaddr; \
|
ElfW(Addr) funcaddr; \
|
||||||
struct link_map **scope; \
|
|
||||||
\
|
\
|
||||||
/* Look up the symbol's run-time value. */ \
|
/* Look up the symbol's run-time value. */ \
|
||||||
scope = _dl_object_relocation_scope (l); \
|
|
||||||
definer = &symtab[sym_index]; \
|
definer = &symtab[sym_index]; \
|
||||||
\
|
\
|
||||||
loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer, \
|
loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer, \
|
||||||
scope, l->l_name, ELF_MACHINE_RELOC_NOPLT); \
|
l->l_scope, l->l_name, \
|
||||||
\
|
ELF_MACHINE_RELOC_NOPLT); \
|
||||||
*_dl_global_scope_end = NULL; \
|
|
||||||
\
|
\
|
||||||
/* Apply the relocation with that value. */ \
|
/* Apply the relocation with that value. */ \
|
||||||
funcaddr = loadbase + definer->st_value; \
|
funcaddr = loadbase + definer->st_value; \
|
||||||
|
Loading…
Reference in New Issue
Block a user