summaryrefslogtreecommitdiff
path: root/ldso/ldso/i386
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-11-10 15:27:26 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-11-10 15:27:26 +0000
commit0038f6a2297be2b66a0177bc74b468dddb0a89fa (patch)
tree2413de564ae1751210c6fd82924636d2b09cebda /ldso/ldso/i386
parent0657ab0d0b7d9a879091653b2e23f0b46c3ecefa (diff)
Add RTLD_LOCAL support for dlopened libs. Reported by
Andrew de Quincey, who has been most helpful getting this sorted out, thanks. Thanks also to Peter Mazinger who did alot of testing. Removed all traces of dl_parse_copy_information() since it is no longer used.
Diffstat (limited to 'ldso/ldso/i386')
-rw-r--r--ldso/ldso/i386/elfinterp.c64
1 files changed, 2 insertions, 62 deletions
diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index 12e67f5d2..cb5a24a9e 100644
--- a/ldso/ldso/i386/elfinterp.c
+++ b/ldso/ldso/i386/elfinterp.c
@@ -147,7 +147,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, ELF_RTYPE_CLASS_PLT);
+ new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
if (unlikely(!new_addr)) {
_dl_dprintf(2, "%s: Can't resolve symbol '%s'\n", _dl_progname, symname);
_dl_exit(1);
@@ -253,7 +253,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
symname = strtab + symtab[symtab_index].st_name;
if (symtab_index) {
- symbol_addr = (unsigned long)_dl_find_hash(symname, scope,
+ symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt,
elf_machine_type_class(reloc_type));
/*
@@ -355,56 +355,6 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
return 0;
}
-/* This is done as a separate step, because there are cases where
- information is first copied and later initialized. This results in
- the wrong information being copied. Someone at Sun was complaining about
- a bug in the handling of _COPY by SVr4, and this may in fact be what he
- was talking about. Sigh. */
-
-/* No, there are cases where the SVr4 linker fails to emit COPY relocs
- at all */
-static int
-_dl_do_copy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
- ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-{
- int reloc_type;
- int symtab_index;
- unsigned long *reloc_addr;
- unsigned long symbol_addr;
- int goof = 0;
- char *symname;
-
- reloc_addr = (unsigned long *)(intptr_t)(tpnt->loadaddr + (unsigned long)rpnt->r_offset);
- reloc_type = ELF32_R_TYPE(rpnt->r_info);
- if (reloc_type != R_386_COPY)
- return 0;
-
- symtab_index = ELF32_R_SYM(rpnt->r_info);
- symbol_addr = 0;
- symname = strtab + symtab[symtab_index].st_name;
-
- if (symtab_index) {
- symbol_addr = (unsigned long)_dl_find_hash(symname, scope, ELF_RTYPE_CLASS_COPY);
- if (!symbol_addr)
- goof++;
- }
-
- if (!goof) {
-#if defined (__SUPPORT_LD_DEBUG__)
- if (_dl_debug_move)
- _dl_dprintf(_dl_debug_file,
- "\n%s move %x bytes from %x to %x",
- symname, symtab[symtab_index].st_size,
- symbol_addr, symtab[symtab_index].st_value);
-#endif
-
- _dl_memcpy((char *)symtab[symtab_index].st_value,
- (char *)symbol_addr, symtab[symtab_index].st_size);
- }
-
- return goof;
-}
-
void
_dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
unsigned long rel_addr,
@@ -420,13 +370,3 @@ _dl_parse_relocation_information(struct dyn_elf *rpnt,
{
return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
}
-
-int
-_dl_parse_copy_information(struct dyn_elf *rpnt,
- unsigned long rel_addr,
- unsigned long rel_size)
-{
- return 0;
- /* just disable for now, remove when we know that it works */
- /* return _dl_parse(rpnt->dyn, rpnt->next, rel_addr, rel_size, _dl_do_copy_reloc); */
-}