summaryrefslogtreecommitdiff
path: root/ldso/ldso/sparc/elfinterp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/ldso/sparc/elfinterp.c')
-rw-r--r--ldso/ldso/sparc/elfinterp.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/ldso/ldso/sparc/elfinterp.c b/ldso/ldso/sparc/elfinterp.c
index 60ec4b0e8..64f769485 100644
--- a/ldso/ldso/sparc/elfinterp.c
+++ b/ldso/ldso/sparc/elfinterp.c
@@ -28,10 +28,7 @@
* SUCH DAMAGE.
*/
-#ifndef VERBOSE_DLINKER
-#define VERBOSE_DLINKER
-#endif
-#ifdef VERBOSE_DLINKER
+#if defined (__SUPPORT_LD_DEBUG__)
static const char * _dl_reltypes[] = { "R_SPARC_NONE", "R_SPARC_8",
"R_SPARC_16", "R_SPARC_32", "R_SPARC_DISP8", "R_SPARC_DISP16",
"R_SPARC_DISP32", "R_SPARC_WDISP30", "R_SPARC_WDISP22",
@@ -103,9 +100,11 @@ unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
_dl_dprintf(2, "symtab_index %d\n", symtab_index);
-#ifdef LD_DEBUG_SYMBOLS
- _dl_dprintf(2, "Resolving symbol %s\n",
- strtab + symtab[symtab_index].st_name);
+#ifdef __SUPPORT_LD_DEBUG__
+ if (_dl_debug_symbols) {
+ _dl_dprintf(2, "Resolving symbol %s\n",
+ strtab + symtab[symtab_index].st_name);
+ }
#endif
/* Get the address of the GOT entry */
@@ -116,20 +115,29 @@ unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
_dl_progname, strtab + symtab[symtab_index].st_name);
_dl_exit(31);
};
-#ifdef LD_NEVER_FIXUP_SYMBOLS
- if((unsigned int) got_addr < 0x40000000) {
- _dl_dprintf(2, "Calling library function: %s\n",
- strtab + symtab[symtab_index].st_name);
- } else {
- got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
- got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
- }
+
+#if defined (__SUPPORT_LD_DEBUG__)
+ if ((unsigned long) got_addr < 0x40000000)
+ {
+ if (_dl_debug_bindings)
+ {
+ _dl_dprintf(_dl_debug_file, "\nresolve function: %s",
+ strtab + symtab[symtab_index].st_name);
+ if(_dl_debug_detail) _dl_dprintf(_dl_debug_file,
+ "\tpatch %x ==> %x @ %x", *got_addr, new_addr, got_addr);
+ }
+ }
+ if (!_dl_debug_nofixups) {
+ got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
+ got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
+ }
#else
- got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
- got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
+ got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
+ got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
#endif
- _dl_dprintf(2, "Address = %x\n",new_addr);
- _dl_exit(32);
+
+ _dl_dprintf(2, "Address = %x\n",new_addr);
+ _dl_exit(32);
return (unsigned int) new_addr;
}
@@ -169,7 +177,7 @@ void _dl_parse_lazy_relocation_information(struct elf_resolve * tpnt, int rel_ad
break;
default:
_dl_dprintf(2, "%s: (LAZY) can't handle reloc type ", _dl_progname);
-#ifdef VERBOSE_DLINKER
+#if defined (__SUPPORT_LD_DEBUG__)
_dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
#endif
if(symtab_index) _dl_dprintf(2, "'%s'\n",
@@ -272,7 +280,7 @@ int _dl_parse_relocation_information(struct elf_resolve * tpnt, int rel_addr,
break;
default:
_dl_dprintf(2, "%s: can't handle reloc type ", _dl_progname);
-#ifdef VERBOSE_DLINKER
+#if defined (__SUPPORT_LD_DEBUG__)
_dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
#endif
if (symtab_index)