archrelease: copy trunk to community-any
[ArchLinux/community.git] / lib32-nss / trunk / 0001-Hack-mpi_x64.s-to-work-with-fno-plt.patch
blobc31594368cf3fa17a0d74ba42c8ca2e43ab06259
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
3 Date: Sat, 12 Dec 2020 13:43:54 +0100
4 Subject: [PATCH] Hack mpi_x64.s to work with -fno-plt
6 ---
7 lib/freebl/mpi/mpi_x86.s | 23 +++++++++++++++++++++--
8 1 file changed, 21 insertions(+), 2 deletions(-)
10 diff --git a/lib/freebl/mpi/mpi_x86.s b/lib/freebl/mpi/mpi_x86.s
11 index 8f7e2130c326..b3ca1ce5b41b 100644
12 --- a/lib/freebl/mpi/mpi_x86.s
13 +++ b/lib/freebl/mpi/mpi_x86.s
14 @@ -22,22 +22,41 @@ is_sse: .long -1
16 .ifndef NO_PIC
17 .macro GET var,reg
18 - movl \var@GOTOFF(%ebx),\reg
19 + call thunk.ax
20 + addl $_GLOBAL_OFFSET_TABLE_, %eax
21 + movl \var@GOTOFF(%eax),\reg
22 .endm
23 .macro PUT reg,var
24 - movl \reg,\var@GOTOFF(%ebx)
25 + call thunk.dx
26 + addl $_GLOBAL_OFFSET_TABLE_, %edx
27 + movl \reg,\var@GOTOFF(%edx)
28 .endm
29 .else
30 .macro GET var,reg
31 movl \var,\reg
32 .endm
33 .macro PUT reg,var
34 movl \reg,\var
35 .endm
36 .endif
38 .text
40 +.ifndef NO_PIC
41 +.globl thunk.ax
42 +.hidden thunk.ax
43 +.type thunk.ax, @function
44 +thunk.ax:
45 + movl (%esp),%eax
46 + ret
48 +.globl thunk.dx
49 +.hidden thunk.dx
50 +.type thunk.dx, @function
51 +thunk.dx:
52 + movl (%esp),%edx
53 + ret
54 +.endif
56 # ebp - 36: caller's esi
57 # ebp - 32: caller's edi