-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from nicola-lunghi/fix-gentoo
Import yocto fixes for 6.6
- Loading branch information
Showing
2 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
* Copyright (c) 2011-2014, Intel Corporation | ||
* Authors: Fenghua Yu <[email protected]>, | ||
* H. Peter Anvin <[email protected]> | ||
* PIC code by: Francisco Blas Izquierdo Riera (klondike) <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
|
@@ -172,7 +173,19 @@ ENTRY(x86_rdseed_or_rdrand_bytes) | |
jmp 4b | ||
ENDPROC(x86_rdseed_or_rdrand_bytes) | ||
|
||
#if defined(__PIC__) | ||
#define INIT_PIC() \ | ||
pushl %ebx ; \ | ||
call __x86.get_pc_thunk.bx ; \ | ||
addl $_GLOBAL_OFFSET_TABLE_, %ebx | ||
#define END_PIC() \ | ||
popl %ebx | ||
#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr | ||
#else | ||
#define INIT_PIC() | ||
#define END_PIC() | ||
#define SETPTR(var,ptr) movl $(var),ptr | ||
#endif | ||
#define PTR0 %eax | ||
#define PTR1 %edx | ||
#define PTR2 %ecx | ||
|
@@ -188,6 +201,7 @@ ENTRY(x86_aes_mangle) | |
movl 8(%ebp), %eax | ||
movl 12(%ebp), %edx | ||
push %esi | ||
INIT_PIC() | ||
#endif | ||
movl $512, CTR3 /* Number of rounds */ | ||
|
||
|
@@ -278,6 +292,7 @@ offset = offset + 16 | |
movdqa %xmm7, (7*16)(PTR1) | ||
|
||
#ifdef __i386__ | ||
END_PIC() | ||
pop %esi | ||
pop %ebp | ||
#endif | ||
|
@@ -292,6 +307,7 @@ ENTRY(x86_aes_expand_key) | |
push %ebp | ||
mov %esp, %ebp | ||
movl 8(%ebp), %eax | ||
INIT_PIC() | ||
#endif | ||
|
||
SETPTR(aes_round_keys, PTR1) | ||
|
@@ -321,6 +337,7 @@ ENTRY(x86_aes_expand_key) | |
call 1f | ||
|
||
#ifdef __i386__ | ||
END_PIC() | ||
pop %ebp | ||
#endif | ||
ret | ||
|
@@ -341,6 +358,16 @@ ENTRY(x86_aes_expand_key) | |
|
||
ENDPROC(x86_aes_expand_key) | ||
|
||
#if defined(__i386__) && defined(__PIC__) | ||
.section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat | ||
.globl __x86.get_pc_thunk.bx | ||
.hidden __x86.get_pc_thunk.bx | ||
.type __x86.get_pc_thunk.bx, @function | ||
__x86.get_pc_thunk.bx: | ||
movl (%esp), %ebx | ||
ret | ||
#endif | ||
|
||
.bss | ||
.balign 64 | ||
aes_round_keys: | ||
|