[uClibc-cvs] uClibc/ldso/ldso/sh64 elfinterp.c,1.3,1.4

Erik Andersen andersen at uclibc.org
Sat Feb 14 11:54:09 UTC 2004


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

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/sh64/elfinterp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- elfinterp.c	14 Feb 2004 11:30:37 -0000	1.3
+++ elfinterp.c	14 Feb 2004 11:54:07 -0000	1.4
@@ -177,7 +177,7 @@
 	strtab = (char *)(tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
 	symname = strtab + symtab[symtab_index].st_name;
 
-	if (reloc_type != R_SH_JMP_SLOT) {
+	if (unlikely(reloc_type != R_SH_JMP_SLOT)) {
 		_dl_dprintf(2, "%s: Incorrect relocation type in jump reloc\n",
 			    _dl_progname);
 		_dl_exit(1);
@@ -191,7 +191,7 @@
 
 	/* Get 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 resolve symbol '%s'\n",
 			    _dl_progname, symname);
 		_dl_exit(1);
@@ -268,7 +268,7 @@
 			_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);
 
 			_dl_dprintf(2, "can't handle reloc type "
@@ -280,7 +280,8 @@
 			);
 
 			_dl_exit(-res);
-		} else if (res > 0) {
+		}
+		if (unlikely(res > 0)) {
 			_dl_dprintf(2, "can't resolve symbol\n");
 
 			return res;




More information about the uClibc-cvs mailing list