OSDN Git Service

Merge remote-tracking branch 'origin/master' into prelink
[uclinux-h8/uClibc.git] / ldso / ldso / x86_64 / elfinterp.c
index 27b1a15..44e2c66 100644 (file)
@@ -70,7 +70,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, tpnt->symbol_scope, tpnt, 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);
@@ -94,9 +94,9 @@ _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
 }
 
 static int
-_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
+_dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope,
          unsigned long rel_addr, unsigned long rel_size,
-         int (*reloc_fnc)(struct elf_resolve *tpnt, struct dyn_elf *scope,
+         int (*reloc_fnc)(struct elf_resolve *tpnt, struct r_scope_elem *scope,
                           ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab))
 {
        unsigned int i;
@@ -151,7 +151,7 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 }
 
 static int
-_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
+_dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
             ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab)
 {
        int reloc_type;
@@ -186,6 +186,9 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
                        /* This may be non-fatal if called from dlopen. */
                        return 1;
                }
+               if (_dl_trace_prelink)
+                       _dl_debug_lookup (symname, tpnt, &symtab[symtab_index],
+                                               &sym_ref, elf_machine_type_class(reloc_type));
                tls_tpnt = sym_ref.tpnt;
        } else {
                /* Relocs against STN_UNDEF are usually treated as using a
@@ -195,7 +198,6 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
                tls_tpnt = tpnt;
        }
 
-
 #if defined (__SUPPORT_LD_DEBUG__)
        old_val = *reloc_addr;
 #endif
@@ -276,7 +278,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
 }
 
 static int
-_dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
+_dl_do_lazy_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
                  ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab)
 {
        int reloc_type;
@@ -326,8 +328,9 @@ _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
 
 int
 _dl_parse_relocation_information(struct dyn_elf *rpnt,
+                                struct r_scope_elem *scope,
                                 unsigned long rel_addr,
                                 unsigned long rel_size)
 {
-       return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
+       return _dl_parse(rpnt->dyn, scope, rel_addr, rel_size, _dl_do_reloc);
 }