summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2011-06-30 14:04:27 -0700
committerRonald S. Bultje <rbultje@google.com>2011-06-30 14:04:27 -0700
commitc8a23ad3f44fdd70fbe759d3d6e27f1e03fb37b9 (patch)
tree5175e782e9a4d843a80118b582327a3e457ddde0
parent8a9a11e8dca2d1ee5d4893d0534ba376baf3bb6c (diff)
downloadlibvpx-c8a23ad3f44fdd70fbe759d3d6e27f1e03fb37b9.tar
libvpx-c8a23ad3f44fdd70fbe759d3d6e27f1e03fb37b9.tar.gz
libvpx-c8a23ad3f44fdd70fbe759d3d6e27f1e03fb37b9.tar.bz2
libvpx-c8a23ad3f44fdd70fbe759d3d6e27f1e03fb37b9.zip
Properly use GET_GOT/RESTORE_GOT when using GLOBAL().
This should fix binaries using PIC on x86-32. Also should fix issue 343. Change-Id: I591de3ad68c8a8bb16054bd8f987a75b4e2bad02
-rw-r--r--vp8/common/x86/recon_sse2.asm8
-rw-r--r--vpx_ports/x86_abi_support.asm2
2 files changed, 9 insertions, 1 deletions
diff --git a/vp8/common/x86/recon_sse2.asm b/vp8/common/x86/recon_sse2.asm
index 00b74387c..0e23116ce 100644
--- a/vp8/common/x86/recon_sse2.asm
+++ b/vp8/common/x86/recon_sse2.asm
@@ -593,8 +593,11 @@ sym(vp8_intra_pred_uv_ho_%1):
push rsi
push rdi
%ifidn %1, ssse3
+%ifndef GET_GOT_SAVE_ARG
push rbx
%endif
+ GET_GOT rbx
+%endif
; end prolog
; read from left and write out
@@ -606,9 +609,9 @@ sym(vp8_intra_pred_uv_ho_%1):
mov rdi, arg(0) ;dst;
movsxd rcx, dword ptr arg(1) ;dst_stride
%ifidn %1, ssse3
- lea rbx, [rax*3]
lea rdx, [rcx*3]
movdqa xmm2, [GLOBAL(dc_00001111)]
+ lea rbx, [rax*3]
%endif
dec rsi
%ifidn %1, mmx2
@@ -656,8 +659,11 @@ vp8_intra_pred_uv_ho_%1_loop:
; begin epilog
%ifidn %1, ssse3
+ RESTORE_GOT
+%ifndef GET_GOT_SAVE_ARG
pop rbx
%endif
+%endif
pop rdi
pop rsi
UNSHADOW_ARGS
diff --git a/vpx_ports/x86_abi_support.asm b/vpx_ports/x86_abi_support.asm
index 37a3205b2..7382a9134 100644
--- a/vpx_ports/x86_abi_support.asm
+++ b/vpx_ports/x86_abi_support.asm
@@ -147,6 +147,7 @@
%if ABI_IS_32BIT
%if CONFIG_PIC=1
%ifidn __OUTPUT_FORMAT__,elf32
+ %define GET_GOT_SAVE_ARG 1
%define WRT_PLT wrt ..plt
%macro GET_GOT 1
extern _GLOBAL_OFFSET_TABLE_
@@ -165,6 +166,7 @@
%define RESTORE_GOT pop %1
%endmacro
%elifidn __OUTPUT_FORMAT__,macho32
+ %define GET_GOT_SAVE_ARG 1
%macro GET_GOT 1
push %1
call %%get_got