summaryrefslogtreecommitdiff
path: root/ldso/ldso/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/ldso/sparc')
-rw-r--r--ldso/ldso/sparc/elfinterp.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/ldso/ldso/sparc/elfinterp.c b/ldso/ldso/sparc/elfinterp.c
index b33ad91b1..3c928073b 100644
--- a/ldso/ldso/sparc/elfinterp.c
+++ b/ldso/ldso/sparc/elfinterp.c
@@ -80,7 +80,7 @@ _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
got_addr = (char **)instr_addr;
/* Get the address of the GOT entry */
- new_addr = _dl_find_hash(symname, &_dl_loaded_modules->symbol_scope, tpnt, NULL, ELF_RTYPE_CLASS_PLT, NULL);
+ new_addr = _dl_find_hash(symname, &_dl_loaded_modules->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL);
if (unlikely(!new_addr)) {
_dl_dprintf(2, "%s: Can't resolve symbol '%s'\n", _dl_progname, symname);
_dl_exit(1);
@@ -171,44 +171,44 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
int symtab_index;
char *symname;
struct elf_resolve *tls_tpnt = 0;
- ElfW(Sym) *sym;
+ struct symbol_ref sym_ref;
ElfW(Addr) *reloc_addr;
ElfW(Addr) symbol_addr;
#if defined (__SUPPORT_LD_DEBUG__)
ElfW(Addr) old_val;
#endif
- struct sym_val current_value = { NULL, NULL };
-
reloc_addr = (ElfW(Addr)*)(tpnt->loadaddr + (unsigned long)rpnt->r_offset);
reloc_type = ELF_R_TYPE(rpnt->r_info);
symtab_index = ELF_R_SYM(rpnt->r_info);
- sym = &symtab[symtab_index];
+ sym_ref.sym = &symtab[symtab_index];
+ sym_ref.tpnt = NULL;
symbol_addr = 0;
- symname = strtab + sym->st_name;
+ symname = strtab + sym_ref.sym->st_name;
if (symtab_index) {
- symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt, &current_value,
- elf_machine_type_class(reloc_type), &tls_tpnt);
+ symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt,
+ elf_machine_type_class(reloc_type), &sym_ref);
/*
* We want to allow undefined references to weak symbols - this
* might have been intentional. We should not be linking local
* symbols here, so all bases should be covered.
*/
- if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym->st_info) != STT_TLS)
- && (ELF_ST_BIND(sym->st_info) != STB_WEAK))) {
+ if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym_ref.sym->st_info) != STT_TLS)
+ && (ELF_ST_BIND(sym_ref.sym->st_info) != STB_WEAK))) {
/* This may be non-fatal if called from dlopen. */
return 1;
}
if (_dl_trace_prelink)
_dl_debug_lookup (symname, tpnt, &symtab[symtab_index],
- &current_value, elf_machine_type_class(reloc_type));
+ &sym_ref, elf_machine_type_class(reloc_type));
+ tls_tpnt = sym_ref.tpnt;
} else {
/* Relocs against STN_UNDEF are usually treated as using a
* symbol value of zero, and using the module containing the
* reloc itself. */
- symbol_addr = sym->st_value;
+ symbol_addr = sym_ref.sym->st_value;
tls_tpnt = tpnt;
}
@@ -267,13 +267,13 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
if (_dl_debug_move)
_dl_dprintf(_dl_debug_file,
"\t%s move %d bytes from %x to %x\n",
- symname, sym->st_size,
+ symname, sym_ref.sym->st_size,
symbol_addr, reloc_addr);
#endif
_dl_memcpy((char *)reloc_addr,
(char *)symbol_addr,
- sym->st_size);
+ sym_ref.sym->st_size);
} else
_dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n");
break;
@@ -285,7 +285,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
case R_SPARC_TLS_DTPOFF32:
/* During relocation all TLS symbols are defined and used.
* Therefore the offset is already correct. */
- *reloc_addr = sym->st_value + rpnt->r_addend;
+ *reloc_addr = sym_ref.sym->st_value + rpnt->r_addend;
break;
case R_SPARC_TLS_TPOFF32:
@@ -294,7 +294,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
* It is a negative value which will be added to the
* thread pointer. */
CHECK_STATIC_TLS ((struct link_map *) tls_tpnt);
- *reloc_addr = sym->st_value - tls_tpnt->l_tls_offset + rpnt->r_addend;
+ *reloc_addr = sym_ref.sym->st_value - tls_tpnt->l_tls_offset + rpnt->r_addend;
break;
#endif
default: