From: caiyinyu Date: Mon, 13 Mar 2023 03:18:30 +0000 (+0800) Subject: aarch64: Standardize code by using macros __glibc_{un,}likely X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e3de9ecd5493cbb38cbe13d8f258953df3165f;p=thirdparty%2Fglibc.git aarch64: Standardize code by using macros __glibc_{un,}likely Improves code readability by using the same macros across code in the sysdeps/aarch64 directory. Reviewed-by: Wilco Dijkstra --- diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 7605b760b8..14a76dd2ef 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -175,9 +175,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], ElfW(Addr) *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info); - if (__builtin_expect (r_type == R_AARCH64_RELATIVE, 0)) + if (__glibc_unlikely (r_type == R_AARCH64_RELATIVE)) *reloc_addr = map->l_addr + reloc->r_addend; - else if (__builtin_expect (r_type == R_AARCH64_NONE, 0)) + else if (__glibc_unlikely (r_type == R_AARCH64_NONE)) return; else { @@ -312,7 +312,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info); /* Check for unexpected PLT reloc type. */ - if (__builtin_expect (r_type == R_AARCH64_JUMP_SLOT, 1)) + if (__glibc_likely (r_type == R_AARCH64_JUMP_SLOT)) { if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL)) { @@ -342,7 +342,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], else *reloc_addr = map->l_mach.plt; } - else if (__builtin_expect (r_type == R_AARCH64_TLSDESC, 1)) + else if (__glibc_likely (r_type == R_AARCH64_TLSDESC)) { const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info); const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]);