diff options
Diffstat (limited to 'sysdeps/sparc/sparc32/dl-machine.h')
-rw-r--r-- | sysdeps/sparc/sparc32/dl-machine.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 460421d996..edeb20b931 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -344,6 +344,8 @@ 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) { + const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); + #ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make the reference weak so static programs can still link. This declaration @@ -353,7 +355,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, weak_extern (_dl_rtld_map); #endif - if (ELF32_R_TYPE (reloc->r_info) == R_SPARC_RELATIVE) + if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0)) { #ifndef RTLD_BOOTSTRAP if (map != &_dl_rtld_map) /* Already done in rtld itself. */ @@ -371,13 +373,13 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, value = map->l_addr; else { - value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info)); + value = RESOLVE (&sym, version, r_type); if (sym) value += sym->st_value; } value += reloc->r_addend; /* Assume copy relocs have zero addend. */ - switch (ELF32_R_TYPE (reloc->r_info)) + switch (r_type) { #ifndef RTLD_BOOTSTRAP case R_SPARC_COPY: @@ -449,7 +451,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, break; #if !defined RTLD_BOOTSTRAP || defined _NDEBUG default: - _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0); + _dl_reloc_bad_type (map, r_type, 0); break; #endif } @@ -457,6 +459,13 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } static inline void +elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *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) { |