From d891064218c362387465ab1ad98e438d8d0b4b91 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 14 Feb 2004 11:54:09 +0000 Subject: Give gcc branch prediction some hits on obviously unlikely branches --- ldso/ldso/sh/elfinterp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ldso/ldso/sh') diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index e0032601c..fe920bb9a 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -136,7 +136,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) 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 relocations\n", _dl_progname); _dl_exit(1); @@ -150,7 +150,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) /* 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); } @@ -222,7 +222,7 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, 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__) @@ -232,7 +232,7 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, #endif _dl_exit(-res); } - else if (res >0) + if (unlikely(res >0)) { _dl_dprintf(2, "can't resolve symbol\n"); return res; -- cgit v1.2.3