summarylogtreecommitdiffstats
path: root/0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch')
-rw-r--r--0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch b/0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch
new file mode 100644
index 000000000000..59597965b0d4
--- /dev/null
+++ b/0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch
@@ -0,0 +1,57 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Sat, 12 Dec 2020 13:43:54 +0100
+Subject: [PATCH] Hack mpi_x64.s to work with -fno-plt
+
+---
+ lib/freebl/mpi/mpi_x86.s | 23 +++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/lib/freebl/mpi/mpi_x86.s b/lib/freebl/mpi/mpi_x86.s
+index 8f7e2130c3..b3ca1ce5b4 100644
+--- a/lib/freebl/mpi/mpi_x86.s
++++ b/lib/freebl/mpi/mpi_x86.s
+@@ -22,22 +22,41 @@ is_sse: .long -1
+ #
+ .ifndef NO_PIC
+ .macro GET var,reg
+- movl \var@GOTOFF(%ebx),\reg
++ call thunk.ax
++ addl $_GLOBAL_OFFSET_TABLE_, %eax
++ movl \var@GOTOFF(%eax),\reg
+ .endm
+ .macro PUT reg,var
+- movl \reg,\var@GOTOFF(%ebx)
++ call thunk.dx
++ addl $_GLOBAL_OFFSET_TABLE_, %edx
++ movl \reg,\var@GOTOFF(%edx)
+ .endm
+ .else
+ .macro GET var,reg
+ movl \var,\reg
+ .endm
+ .macro PUT reg,var
+ movl \reg,\var
+ .endm
+ .endif
+
+ .text
+
++.ifndef NO_PIC
++.globl thunk.ax
++.hidden thunk.ax
++.type thunk.ax, @function
++thunk.ax:
++ movl (%esp),%eax
++ ret
++
++.globl thunk.dx
++.hidden thunk.dx
++.type thunk.dx, @function
++thunk.dx:
++ movl (%esp),%edx
++ ret
++.endif
+
+ # ebp - 36: caller's esi
+ # ebp - 32: caller's edi