[uClibc-cvs] CVS uClibc/ldso/ldso/powerpc

CVS User jocke jocke at codepoet.org
Fri Sep 17 12:19:35 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso/powerpc
In directory nail:/tmp/cvs-serv6784

Modified Files:
	elfinterp.c 
Log Message:
Bugfix: Add r_addend to final address. The r_addend is mostly zero
but can be nonzero for JMP relocs as well.
All Rela arches need to do this, test and send a patch :)

Remove unneeded test in R_PPC_COPY.


--- /var/cvs/uClibc/ldso/ldso/powerpc/elfinterp.c	2004/09/16 13:07:01	1.44
+++ /var/cvs/uClibc/ldso/ldso/powerpc/elfinterp.c	2004/09/17 12:19:35	1.45
@@ -215,7 +215,7 @@
 		_dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
 		_dl_exit(1);
 	};
-
+	finaladdr += this_reloc->r_addend;
 #if defined (__SUPPORT_LD_DEBUG__)
 	if(_dl_debug_reloc && _dl_debug_detail)
 		_dl_dprintf(_dl_debug_file, "%x\n", finaladdr);
@@ -319,15 +319,13 @@
 		break;
 	}
 	case R_PPC_COPY:
-		if (symbol_addr) {
 #if defined (__SUPPORT_LD_DEBUG__)
-			if(_dl_debug_move)
-				_dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
-					    symname, symtab[symtab_index].st_size,
-					    symbol_addr, reloc_addr);
+		if(_dl_debug_move)
+			_dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
+				    symname, symtab[symtab_index].st_size,
+				    symbol_addr, reloc_addr);
 #endif
-			_dl_memcpy((char *) reloc_addr, (char *) finaladdr, symtab[symtab_index].st_size);
-		}
+		_dl_memcpy((char *) reloc_addr, (char *) finaladdr, symtab[symtab_index].st_size);
 		goto out_nocode; /* No code code modified */
 	case R_PPC_ADDR16_HA:
 		finaladdr += 0x8000; /* fall through. */



More information about the uClibc-cvs mailing list