summaryrefslogtreecommitdiff
path: root/ldso/ldso/bfin
diff options
context:
space:
mode:
authorFilippo Arcidiacono <filippo.arcidiacono@st.com>2010-10-11 12:56:21 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-10-11 12:58:04 +0200
commit4ec89b87bc0eea8d9ca6b50564d12eeb3b1b0119 (patch)
treebaf8ca74e568ca5f8468a1913376832689a9899a /ldso/ldso/bfin
parent8d29ef117dba66ab67419a69d272779d50f147f0 (diff)
ldso: Extend prelink support for all other achitectures
Update Arch specific part of the dynamic linker to the latest cahnges required by prelink: - Use _dl_loaded_modules->scope as global symbol scope - Pass the sym argument (or NULL) to the _dl_find_hash - Update _dl_parse, _dl_do_reloc, _dl_do_lazy_reloc and _dl_parse_relocation_information to reflect the change of the scope argument's type - Add the call to _dl_debug_lookup used for trace prelinking. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso/ldso/bfin')
-rw-r--r--ldso/ldso/bfin/elfinterp.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/ldso/ldso/bfin/elfinterp.c b/ldso/ldso/bfin/elfinterp.c
index e8d88bd5a..466a3b4c1 100644
--- a/ldso/ldso/bfin/elfinterp.c
+++ b/ldso/ldso/bfin/elfinterp.c
@@ -65,9 +65,9 @@ _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry)
got_entry = (struct funcdesc_value *) DL_RELOC_ADDR(tpnt->loadaddr, this_reloc->r_offset);
/* Get the address to be used to fill in the GOT entry. */
- new_addr = _dl_lookup_hash(symname, tpnt->symbol_scope, NULL, 0, &new_tpnt);
+ new_addr = _dl_lookup_hash(symname, &_dl_loaded_modules->symbol_scope, NULL, NULL, 0, &new_tpnt);
if (!new_addr) {
- new_addr = _dl_lookup_hash(symname, NULL, NULL, 0, &new_tpnt);
+ new_addr = _dl_lookup_hash(symname, NULL, NULL, NULL, 0, &new_tpnt);
if (!new_addr) {
_dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
_dl_progname, symname);
@@ -99,9 +99,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;
@@ -150,7 +150,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;
@@ -166,6 +166,8 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
unsigned long old_val;
#endif
+ struct sym_val current_value = { NULL, NULL };
+
reloc_addr = (unsigned long *) DL_RELOC_ADDR(tpnt->loadaddr, rpnt->r_offset);
__asm__ ("" : "=r" (reloc_addr_packed) : "0" (reloc_addr));
reloc_type = ELF_R_TYPE(rpnt->r_info);
@@ -179,7 +181,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
} else {
symbol_addr = (unsigned long)
- _dl_lookup_hash(symname, scope, NULL, 0, &symbol_tpnt);
+ _dl_lookup_hash(symname, scope, NULL, &current_value, 0, &symbol_tpnt);
/*
* We want to allow undefined references to weak symbols - this might
@@ -192,6 +194,9 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
_dl_progname, strtab + symtab[symtab_index].st_name);
_dl_exit (1);
}
+ if (_dl_trace_prelink)
+ _dl_debug_lookup (symname, tpnt, &symtab[symtab_index],
+ &current_value, elf_machine_type_class(reloc_type));
}
#if defined (__SUPPORT_LD_DEBUG__)
@@ -275,7 +280,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 __attribute__((unused)),
+ struct r_scope_elem *scope __attribute__((unused)),
ELF_RELOC *rpnt, ElfW(Sym) *symtab __attribute__((unused)),
char *strtab __attribute__((unused)))
{
@@ -321,9 +326,9 @@ _dl_parse_lazy_relocation_information
int
_dl_parse_relocation_information
-(struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size)
+(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);
}
/* We don't have copy relocs. */