aboutsummaryrefslogtreecommitdiffstats
path: root/main/rng-tools/fix-textrels-on-PIC-x86.patch
blob: ee6fe108b988bb85fc906e66f53b639083521ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/rdrand_asm.S
+++ b/rdrand_asm.S
@@ -83,6 +83,7 @@
 	jmp	4b
 ENDPROC(x86_rdseed_or_rdrand_bytes)
 
+#define INIT_PIC()
 #define SETPTR(var,ptr)	leaq var(%rip),ptr
 #define PTR0	%rdi
 #define PTR1	%rsi
@@ -180,6 +190,7 @@
 #define NPTR2	1	/* %rcx = %r1 */
 
 #endif
+	INIT_PIC()
 
 ENTRY(x86_aes_mangle)
 #ifdef __i386__
@@ -283,6 +294,17 @@
 #endif
 	ret
 ENDPROC(x86_aes_mangle)
+
+#if defined(__i386__) && defined(__PIC__)
+	.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+.globl __i686.get_pc_thunk.bx
+	.hidden  __i686.get_pc_thunk.bx
+	.type    __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+	movl (%esp), %ebx
+	ret
+#endif
+
 
 /* aeskeygenassist $imm,%xmm0,%xmm1 */
 #define AESKEYGENASSIST(imm) .byte 0x66,0x0f,0x3a,0xdf,0xc8,imm