From 85bdccdbd293eb72027ac5705c5f33cdbd243180 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 24 Aug 2001 08:43:21 +0000 Subject: Define elf_machine_rel_relative. Minor optimizations. --- sysdeps/m68k/dl-machine.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sysdeps/m68k') diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index c4849b078c..e3a5a24586 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -232,16 +232,18 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, Elf32_Addr *const reloc_addr) { - if (ELF32_R_TYPE (reloc->r_info) == R_68K_RELATIVE) + const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); + + if (__builtin_expect (r_type == R_68K_RELATIVE, 0)) *reloc_addr = map->l_addr + reloc->r_addend; else { const Elf32_Sym *const refsym = sym; - Elf32_Addr value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info)); + Elf32_Addr value = RESOLVE (&sym, version, r_type); if (sym) value += sym->st_value; - switch (ELF32_R_TYPE (reloc->r_info)) + switch (r_type) { case R_68K_COPY: if (sym == NULL) @@ -290,12 +292,19 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, case R_68K_NONE: /* Alright, Wilbur. */ break; default: - _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 0); + _dl_reloc_bad_type (map, r_type, 0); break; } } } +static inline void +elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, + Elf32_Addr *const reloc_addr) +{ + *reloc_addr = l_addr + reloc->r_addend; +} + static inline void elf_machine_lazy_rel (struct link_map *map, Elf32_Addr l_addr, const Elf32_Rela *reloc) -- cgit v1.2.3