[uClibc-cvs] uClibc/ldso/ldso/arm elfinterp.c,1.19,1.20

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


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

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/arm/elfinterp.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- elfinterp.c	14 Feb 2004 11:30:31 -0000	1.19
+++ elfinterp.c	14 Feb 2004 11:53:48 -0000	1.20
@@ -137,7 +137,7 @@
 	symname = strtab + symtab[symtab_index].st_name;
 
 
-	if (reloc_type != R_ARM_JUMP_SLOT) {
+	if (unlikely(reloc_type != R_ARM_JUMP_SLOT)) {
 		_dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
 			_dl_progname);
 		_dl_exit(1);
@@ -151,7 +151,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);
@@ -223,7 +223,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__)
@@ -233,7 +233,7 @@
 #endif
 			_dl_exit(-res);
 		}
-		else if (res >0)
+		if (unlikely(res >0))
 		{
 			_dl_dprintf(2, "can't resolve symbol\n");
 			goof += res;
@@ -321,7 +321,7 @@
 						newvalue = fix_bad_pc24(reloc_addr, symbol_addr)
 							- (unsigned long)reloc_addr + (addend << 2);
 						topbits = newvalue & 0xfe000000;
-						if (topbits != 0xfe000000 && topbits != 0x00000000)
+						if (unlikely(topbits != 0xfe000000 && topbits != 0x00000000))
 						{
 							_dl_dprintf(2,"symbol '%s': R_ARM_PC24 relocation out of range.",
 								symtab[symtab_index].st_name);




More information about the uClibc-cvs mailing list