[uClibc-cvs] uClibc/ldso/ldso/cris elfinterp.c,1.8,1.9

Erik Andersen andersen at uclibc.org
Sat Feb 14 11:53:56 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso/cris
In directory nail:/home/andersen/CVS/uClibc/ldso/ldso/cris

Modified Files:
	elfinterp.c 
Log Message:
Give gcc branch prediction some hits on obviously unlikely branches


Index: elfinterp.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/cris/elfinterp.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- elfinterp.c	14 Feb 2004 11:30:32 -0000	1.8
+++ elfinterp.c	14 Feb 2004 11:53:54 -0000	1.9
@@ -131,7 +131,7 @@
 	strtab = (char *)(tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
 	symname = strtab + symtab[symtab_index].st_name;
 
-	if (reloc_type != R_CRIS_JUMP_SLOT) {
+	if (unlikely(reloc_type != R_CRIS_JUMP_SLOT)) {
 		_dl_dprintf(2, "%s: Incorrect relocation type for jump relocations.\n",
 			_dl_progname);
 		_dl_exit(1);
@@ -143,7 +143,7 @@
 
 	/* Fetch the address of the GOT entry. */
 	new_addr = _dl_find_hash(symname, tpnt->symbol_scope, ELF_RTYPE_CLASS_PLT);
-	if (!new_addr) {
+	if (unlikely(!new_addr)) {
 	    _dl_dprintf(2, "%s: Can't resolv symbol '%s'\n", _dl_progname, symname);
 	    _dl_exit(1);
 	}
@@ -210,7 +210,7 @@
 		if (symtab_index)
 			_dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
 
-		if (res < 0) {
+		if (unlikely(res < 0)) {
 			int reloc_type = ELF32_R_TYPE(rpnt->r_info);
 
 #if defined (__SUPPORT_LD_DEBUG__)
@@ -220,7 +220,7 @@
 #endif
 			_dl_exit(-res);
 		}
-		else if (res > 0) {
+		if (unlikely(res > 0)) {
 			_dl_dprintf(2, "can't resolv symbol\n");
 			return res;
 		}




More information about the uClibc-cvs mailing list