From 449caad5c792628b138bb84f4092de071af652e5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 5 Nov 2002 18:21:12 +0000 Subject: Massive scrubbing of the shared lib loader error handling. Move all configuration options into the new config system. -Erik --- ldso/ldso/arm/elfinterp.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'ldso/ldso/arm') diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index 84b94550b..e46ae51a4 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ -#if defined (SUPPORT_LD_DEBUG) || defined (LD_DEBUG_SYMBOLS) +#if defined (__SUPPORT_LD_DEBUG__) static const char *_dl_reltypes_tab[] = [0] "R_ARM_NONE", "R_ARM_PC24", "R_ARM_ABS32", "R_ARM_REL32", [4] "R_ARM_PC13", "R_ARM_ABS16", "R_ARM_ABS12", "R_ARM_THM_ABS5", @@ -153,22 +153,19 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) _dl_progname, strtab + symtab[symtab_index].st_name); _dl_exit(1); }; -#if defined (SUPPORT_LD_DEBUG) || defined (LD_NEVER_FIXUP_SYMBOLS) +#if defined (__SUPPORT_LD_DEBUG__) if ((unsigned long) got_addr < 0x40000000) { -#ifndef SUPPORT_LD_DEBUG - 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); - } -#endif -#ifndef LD_NEVER_FIXUP_SYMBOLS - *got_addr = new_addr; -#endif - } else { - *got_addr = new_addr; + 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 = new_addr; } #else *got_addr = new_addr; @@ -210,7 +207,7 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, _dl_symbol(strtab + symtab[symtab_index].st_name)) continue; -#if defined (SUPPORT_LD_DEBUG) || defined (LD_DEBUG_SYMBOLS) +#if defined (__SUPPORT_LD_DEBUG__) debug_sym(symtab,strtab,symtab_index); debug_reloc(symtab,strtab,rpnt); #endif @@ -227,7 +224,7 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, if (res <0) { int reloc_type = ELF32_R_TYPE(rpnt->r_info); -#if defined (SUPPORT_LD_DEBUG) +#if defined (__SUPPORT_LD_DEBUG__) _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type)); #else _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type); @@ -297,7 +294,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, } } -#if defined (SUPPORT_LD_DEBUG) +#if defined (__SUPPORT_LD_DEBUG__) { unsigned long old_val = *reloc_addr; #endif @@ -354,7 +351,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, default: return -1; /*call _dl_exit(1) */ } -#if defined (SUPPORT_LD_DEBUG) +#if defined (__SUPPORT_LD_DEBUG__) if(_dl_debug_reloc && _dl_debug_detail) _dl_dprintf(_dl_debug_file, "\tpatch: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); } @@ -374,7 +371,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, reloc_addr = (unsigned long *) (tpnt->loadaddr + (unsigned long) rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); -#if defined (SUPPORT_LD_DEBUG) +#if defined (__SUPPORT_LD_DEBUG__) { unsigned long old_val = *reloc_addr; #endif @@ -387,7 +384,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, default: return -1; /*call _dl_exit(1) */ } -#if defined (SUPPORT_LD_DEBUG) +#if defined (__SUPPORT_LD_DEBUG__) if(_dl_debug_reloc && _dl_debug_detail) _dl_dprintf(_dl_debug_file, "\tpatch: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); } @@ -430,7 +427,7 @@ _dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope, if (!symbol_addr) goof++; } if (!goof) { -#if defined (SUPPORT_LD_DEBUG) +#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, -- cgit v1.2.3