[uClibc-cvs] svn commit: trunk/uClibc/ldso/ldso/sh

vapier at uclibc.org vapier at uclibc.org
Tue Aug 9 23:05:06 UTC 2005


Author: vapier
Date: 2005-08-09 17:05:06 -0600 (Tue, 09 Aug 2005)
New Revision: 11091

Log:
clean up whitespace/syntax

Modified:
   trunk/uClibc/ldso/ldso/sh/elfinterp.c


Changeset:
Modified: trunk/uClibc/ldso/ldso/sh/elfinterp.c
===================================================================
--- trunk/uClibc/ldso/ldso/sh/elfinterp.c	2005-08-09 22:43:02 UTC (rev 11090)
+++ trunk/uClibc/ldso/ldso/sh/elfinterp.c	2005-08-09 23:05:06 UTC (rev 11091)
@@ -61,21 +61,19 @@
 	symtab_index = ELF32_R_SYM(this_reloc->r_info);
 
 	symtab = (Elf32_Sym *)(intptr_t) tpnt->dynamic_info[DT_SYMTAB];
-	strtab = (char *) tpnt->dynamic_info[DT_STRTAB];
+	strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
 	symname = strtab + symtab[symtab_index].st_name;
 
 	if (unlikely(reloc_type != R_SH_JMP_SLOT)) {
-	  _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
-		       _dl_progname);
-	  _dl_exit(1);
+		_dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
+		            _dl_progname);
+		_dl_exit(1);
 	}
 
 	/* Address of jump instruction to fix up */
-	instr_addr = ((unsigned long) this_reloc->r_offset +
-			(unsigned long) tpnt->loadaddr);
+	instr_addr = (unsigned long) (this_reloc->r_offset + tpnt->loadaddr);
 	got_addr = (char **) instr_addr;
 
-
 	/* Get the address of the GOT entry */
 	new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
 	if (unlikely(!new_addr)) {
@@ -84,18 +82,15 @@
 	}
 
 #if defined (__SUPPORT_LD_DEBUG__)
-	if ((unsigned long) got_addr < 0x20000000)
-	{
-		if (_dl_debug_bindings)
-		{
+	if ((unsigned long) got_addr < 0x20000000) {
+		if (_dl_debug_bindings) {
 			_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);
 		}
 	}
-	if (!_dl_debug_nofixups) {
+	if (!_dl_debug_nofixups)
 		*got_addr = new_addr;
-	}
 #else
 	*got_addr = new_addr;
 #endif
@@ -123,25 +118,24 @@
 	symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB];
 	strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
 
-	  for (i = 0; i < rel_size; i++, rpnt++) {
-	        int res;
+	for (i = 0; i < rel_size; i++, rpnt++) {
+		int res;
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
 
-		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
+		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);
 
-		if (res==0) continue;
+		if (res == 0) continue;
 
 		_dl_dprintf(2, "\n%s: ",_dl_progname);
 
 		if (symtab_index)
-		  _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
+			_dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
 
-		if (unlikely(res <0))
-		{
-		        int reloc_type = ELF32_R_TYPE(rpnt->r_info);
+		if (unlikely(res < 0)) {
+			int reloc_type = ELF32_R_TYPE(rpnt->r_info);
 #if defined (__SUPPORT_LD_DEBUG__)
 			_dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
 #else
@@ -149,13 +143,12 @@
 #endif
 			_dl_exit(-res);
 		}
-		if (unlikely(res >0))
-		{
+		if (unlikely(res > 0)) {
 			_dl_dprintf(2, "can't resolve symbol\n");
 			return res;
 		}
-	  }
-	  return 0;
+	}
+	return 0;
 }
 
 
@@ -163,7 +156,7 @@
 _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
 	      ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
 {
-        int reloc_type;
+	int reloc_type;
 	int symtab_index;
 	char *symname;
 	unsigned long *reloc_addr;
@@ -176,7 +169,7 @@
 	reloc_type = ELF32_R_TYPE(rpnt->r_info);
 	symtab_index = ELF32_R_SYM(rpnt->r_info);
 	symbol_addr = 0;
-	symname      = strtab + symtab[symtab_index].st_name;
+	symname = strtab + symtab[symtab_index].st_name;
 
 	if (symtab_index) {
 		symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt,
@@ -188,17 +181,16 @@
 		 * here, so all bases should be covered.
 		 */
 		if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK) {
-			_dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
-				     _dl_progname, strtab + symtab[symtab_index].st_name);
+			_dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
+			            _dl_progname, strtab + symtab[symtab_index].st_name);
 			_dl_exit (1);
 		}
 	}
 
-
 #if defined (__SUPPORT_LD_DEBUG__)
 	old_val = *reloc_addr;
 #endif
-	    switch (reloc_type) {
+	switch (reloc_type) {
 		case R_SH_NONE:
 			break;
 		case R_SH_COPY:
@@ -226,7 +218,7 @@
 			break;
 		default:
 			return -1; /*call _dl_exit(1) */
-	    }
+	}
 #if defined (__SUPPORT_LD_DEBUG__)
 	    if(_dl_debug_reloc && _dl_debug_detail)
 		_dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
@@ -255,17 +247,17 @@
 #if defined (__SUPPORT_LD_DEBUG__)
 	old_val = *reloc_addr;
 #endif
-	    switch (reloc_type) {
-	      case R_SH_NONE:
-		break;
-	      case R_SH_JMP_SLOT:
-		*reloc_addr += (unsigned long) tpnt->loadaddr;
-		break;
-	      default:
-	        return -1; /*call _dl_exit(1) */
-	    }
+	switch (reloc_type) {
+		case R_SH_NONE:
+			break;
+		case R_SH_JMP_SLOT:
+			*reloc_addr += (unsigned long) tpnt->loadaddr;
+			break;
+		default:
+			return -1; /*call _dl_exit(1) */
+	}
 #if defined (__SUPPORT_LD_DEBUG__)
-	    if(_dl_debug_reloc && _dl_debug_detail)
+	if(_dl_debug_reloc && _dl_debug_detail)
 		_dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
 #endif
 	return 0;
@@ -283,4 +275,3 @@
 {
 	return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
 }
-




More information about the uClibc-cvs mailing list