summaryrefslogtreecommitdiff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/dl-runtime.c9
-rw-r--r--sysdeps/x86_64/dl-trampoline.S12
2 files changed, 9 insertions, 12 deletions
diff --git a/sysdeps/x86_64/dl-runtime.c b/sysdeps/x86_64/dl-runtime.c
new file mode 100644
index 0000000000..b625d1e882
--- /dev/null
+++ b/sysdeps/x86_64/dl-runtime.c
@@ -0,0 +1,9 @@
+/* The ABI calls for the PLT stubs to pass the index of the relocation
+ and not its offset. In _dl_profile_fixup and _dl_call_pltexit we
+ also use the index. Therefore it is wasteful to compute the offset
+ in the trampoline just to reverse the operation immediately
+ afterwards. */
+#define reloc_offset reloc_arg * sizeof (PLTREL)
+#define reloc_index reloc_arg
+
+#include <elf/dl-runtime.c>
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index c9be759e37..0ae47a47db 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -35,10 +35,6 @@ _dl_runtime_resolve:
movq %r8, 40(%rsp)
movq %r9, 48(%rsp)
movq 64(%rsp), %rsi # Copy args pushed by PLT in register.
- movq %rsi, %r11 # Multiply by 24
- addq %r11, %rsi
- addq %r11, %rsi
- shlq $3, %rsi
movq 56(%rsp), %rdi # %rdi: link_map, %rsi: reloc_offset
call _dl_fixup # Call resolver.
movq %rax, %r11 # Save return value
@@ -116,10 +112,6 @@ _dl_runtime_profile:
movq %rsp, %rcx # La_x86_64_regs pointer to %rcx.
movq 48(%rbx), %rdx # Load return address if needed.
movq 40(%rbx), %rsi # Copy args pushed by PLT in register.
- movq %rsi,%r11 # Multiply by 24.
- addq %r11,%rsi
- addq %r11,%rsi
- shlq $3, %rsi
movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_offset
leaq 16(%rbx), %r8
call _dl_profile_fixup # Call resolver.
@@ -204,10 +196,6 @@ _dl_runtime_profile:
movq 24(%rbx), %rdx # La_x86_64_regs argument to %rdx.
movq 40(%rbx), %rsi # Copy args pushed by PLT in register.
- movq %rsi,%r11 # Multiply by 24.
- addq %r11,%rsi
- addq %r11,%rsi
- shlq $3, %rsi
movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_offset
call _dl_call_pltexit