summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-08-19 14:08:44 +0000
committerEric Andersen <andersen@codepoet.org>2003-08-19 14:08:44 +0000
commitfebf8aecdc7a78b49bf955748f45711b08d5bee6 (patch)
tree755fba7979514b44d619f1ad7ab24822a4401667
parent2711bc5895accc67e27232d9b75fc12c7994837f (diff)
More routine cleanup
-rw-r--r--ldso/ldso/i386/elfinterp.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index 7f2b8ff71..5ccad3259 100644
--- a/ldso/ldso/i386/elfinterp.c
+++ b/ldso/ldso/i386/elfinterp.c
@@ -119,6 +119,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
char *new_addr;
char **got_addr;
unsigned long instr_addr;
+ char *symname;
rel_addr = (char *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
@@ -128,6 +129,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
+ symname= strtab + symtab[symtab_index].st_name;
if (reloc_type != R_386_JMP_SLOT) {
_dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
@@ -141,11 +143,13 @@ unsigned long _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(strtab + symtab[symtab_index].st_name,
- tpnt->symbol_scope, tpnt, resolver);
+ new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, resolver);
if (!new_addr) {
- _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
- _dl_progname, strtab + symtab[symtab_index].st_name);
+ new_addr = _dl_find_hash(symname, NULL, NULL, resolver);
+ if (new_addr) {
+ return (unsigned long) new_addr;
+ }
+ _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
_dl_exit(1);
}
@@ -154,8 +158,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
{
if (_dl_debug_bindings)
{
- _dl_dprintf(_dl_debug_file, "\nresolve function: %s",
- strtab + symtab[symtab_index].st_name);
+ _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
if(_dl_debug_detail) _dl_dprintf(_dl_debug_file,
"\n\tpatched %x ==> %x @ %x\n", *got_addr, new_addr, got_addr);
}
@@ -361,6 +364,7 @@ _dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
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);
@@ -368,20 +372,17 @@ _dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
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(strtab +
- symtab[symtab_index].st_name, scope,
- NULL, copyrel);
+ symbol_addr = (unsigned long) _dl_find_hash(symname, scope, NULL, copyrel);
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",
- strtab + symtab[symtab_index].st_name,
- symtab[symtab_index].st_size,
+ symname, symtab[symtab_index].st_size,
symbol_addr, symtab[symtab_index].st_value);
#endif
_dl_memcpy((char *) symtab[symtab_index].st_value,