summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-11-06 13:03:42 +0000
committerEric Andersen <andersen@codepoet.org>2003-11-06 13:03:42 +0000
commit40759f358c6a457b2e8c132cd135b9c546298be4 (patch)
tree9b8ce7564561eb9ec44d1e4b47ae4fd30293f2d8
parent576a7e49c580b61e4d44d9e087d43428ec601487 (diff)
A few debugging cleanups
-rw-r--r--ldso/ldso/powerpc/elfinterp.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index 9e5d11030..e3b39de16 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -170,10 +170,9 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
unsigned long insn_addr;
unsigned long *insns;
unsigned long new_addr;
+ char *symname;
int delta;
- //DPRINTF("linux_resolver tpnt=%x reloc_entry=%x\n", tpnt, reloc_entry);
-
rel_addr = (ELF_RELOC *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
this_reloc = (void *)rel_addr + reloc_entry;
@@ -182,8 +181,10 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
+ symname = strtab + symtab[symtab_index].st_name;
#if defined (__SUPPORT_LD_DEBUG__)
+ debug_sym(symtab,strtab,symtab_index);
debug_reloc(symtab,strtab,this_reloc);
#endif
@@ -196,7 +197,10 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
insn_addr = (unsigned long) tpnt->loadaddr +
(unsigned long) this_reloc->r_offset;
- //DPRINTF("Resolving symbol %s %x --> ", strtab + symtab[symtab_index].st_name, insn_addr);
+#if defined (__SUPPORT_LD_DEBUG__)
+ if(_dl_debug_reloc && _dl_debug_detail)
+ _dl_dprintf(_dl_debug_file, "\n\tResolving symbol %s %x --> ", symname, insn_addr);
+#endif
/* Get the address of the GOT entry */
new_addr = (unsigned long) _dl_find_hash(
@@ -204,10 +208,14 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
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);
+ _dl_progname, symname);
_dl_exit(1);
};
- //DPRINTF("%x\n", new_addr);
+
+#if defined (__SUPPORT_LD_DEBUG__)
+ if(_dl_debug_reloc && _dl_debug_detail)
+ _dl_dprintf(_dl_debug_file, "%x\n", new_addr);
+#endif
insns = (unsigned long *)insn_addr;
delta = new_addr - insn_addr;
@@ -442,7 +450,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
break;
#else
_dl_dprintf(2, "%s: symbol '%s' is type R_PPC_REL24\n\tCompile shared libraries with -fPIC!\n",
- _dl_progname, strtab + symtab[symtab_index].st_name);
+ _dl_progname, symname);
_dl_exit(1);
#endif
case R_PPC_RELATIVE: