diff options
author | David S. Miller <davem@davemloft.net> | 2011-06-20 19:56:40 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-20 19:56:40 -0700 |
commit | 42675c6ff0e95346de8a2cbc066e14e0d6a856e4 (patch) | |
tree | 2350fafe239e6a63d30f480628cc1f1d86e0b5a4 /sysdeps/sparc/sparc64/dl-irel.h | |
parent | 57912a71cc379f8582e3ea272782dc39c6c02e45 (diff) | |
download | glibc-42675c6ff0e95346de8a2cbc066e14e0d6a856e4.tar.gz glibc-42675c6ff0e95346de8a2cbc066e14e0d6a856e4.tar.xz glibc-42675c6ff0e95346de8a2cbc066e14e0d6a856e4.zip |
Add an elf_ifunc_invoke interface so that architectures can implement
the ifunc resolver calls however they wish.
Diffstat (limited to 'sysdeps/sparc/sparc64/dl-irel.h')
-rw-r--r-- | sysdeps/sparc/sparc64/dl-irel.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/sparc/sparc64/dl-irel.h b/sysdeps/sparc/sparc64/dl-irel.h index 0d70e2a448..e356ac6420 100644 --- a/sysdeps/sparc/sparc64/dl-irel.h +++ b/sysdeps/sparc/sparc64/dl-irel.h @@ -28,6 +28,13 @@ #define ELF_MACHINE_IRELA 1 +static inline Elf64_Addr +__attribute ((always_inline)) +elf_ifunc_invoke (Elf64_Addr addr) +{ + return ((Elf64_Addr (*) (int)) (addr)) (GLRO(dl_hwcap)); +} + static inline void __attribute ((always_inline)) elf_irela (const Elf64_Rela *reloc) @@ -37,13 +44,13 @@ elf_irela (const Elf64_Rela *reloc) if (__builtin_expect (r_type == R_SPARC_IRELATIVE, 1)) { Elf64_Addr *const reloc_addr = (void *) reloc->r_offset; - Elf64_Addr value = ((Elf64_Addr (*) (int)) reloc->r_addend) (GLRO(dl_hwcap)); + Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend); *reloc_addr = value; } else if (__builtin_expect (r_type == R_SPARC_JMP_IREL, 1)) { Elf64_Addr *const reloc_addr = (void *) reloc->r_offset; - Elf64_Addr value = ((Elf64_Addr (*) (int)) reloc->r_addend) (GLRO(dl_hwcap)); + Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend); struct link_map map = { .l_addr = 0 }; /* 'high' is always zero, for large PLT entries the linker |